Ask a Question

getting BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy'

SOLVED
arunbharath
Contributor

getting BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy'

Hi All. I'm working on the script library in readyAPI 2.8.0

I have a readyAPI project saved in C/soapui and I've created a folder called GroovyLibrary inside the project folder (C/soapui/GroovyLibrary). I place my below script inside the groovyLibrary folder.

package soapui .GroovyLibrary

class Callee
{
String hello()
{
return "Hello world!"
}
def static salute( who, log ) { log.info "Hello again $who!" }}

 

I followed the exact the way it mentioned in the below documentation

https://support.smartbear.com/readyapi/docs/testing/scripts/library.html#_ga=2.210636115.718279044.1...

but while executing the groovy from readyAPI; I'm getting below execption 

BUG! exception in phase 'semantic analysis' in source unit 'Script2.groovy' The lookup for Callee caused a failed compilaton. There should not have been any compilation from this call.

How can I rectify this? anyhelp would be appreciated.

 

Thanks.

 

 

9 REPLIES 9
TanyaYatskovska
SmartBear Alumni (Retired)

HI @arunbharath,

 

Could you please make sure that you have a closed bracket { at the end of the Callee.groovy file? I don't see it at the moment.

Community, @jsheph01,@JoostDG@AlexKaras, what can be the cause of this error from your point of view?

 

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



@TanyaYatskovska  That was a copy - paste issue while phrasing the question. But In my script, I've closed all the brackets.

Is it possible to show the screen shot of the script along with the stactrace of the error/exception that you get?


Regards,
Rao.

groovyCalle.JPG

Thank you for that.
Stacktrace?

What is the OS, its version?
What is ReadyAPI version?
Is it possible to show system properties. In the tool, use Menu -> Help -> system properties


Regards,
Rao.

Thanks for your reply. please find the info.

OS: Windows 10

ReadyAPI version : 2.8.0

 

PFA of System properties

Thanks for the details.

Looks like you are hitting some know bug (not directly realated to ReadyAPI, but coming from under line libraries, IMO)

https://www.google.com/search?client=ubuntu&channel=fs&q=BUG%21+exception+in+phase+%27semantic+analy...


Regards,
Rao.

Is there any alternate approach? I want to automate UI using selenium for that I need some common class in a script. so I can re-use the script by calling its method with paramaters.

 

In Other words, 

    1) I need a class in groovy with couple of methods like login(string ,string), logout()

    2) In readyAPI , I have to call above login(string ,string) in anotherscript with paramaters. How can I achieve this? I'm stuked. any help is appreciated.

sonya_m
SmartBear Alumni (Retired)

Thanks everyone for trying to help!  

 

Hi @arunbharath , it’s also worth updating ReadyAPI to 3.0.0 and checking if the issue still persists.

If it does, I would suggest contacting the Support Team since this might require deeper investigation. Thank you.  


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: