Forum Discussion

arunbharath's avatar
arunbharath
Contributor
6 years ago

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.1573586134-774997694.1532459669

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.

 

 

  • TanyaYatskovska's avatar
    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,JoostDGAlexKaras, what can be the cause of this error from your point of view?

     

     

    • arunbharath's avatar
      arunbharath
      Contributor

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

      • nmrao's avatar
        nmrao
        Champion Level 3
        Is it possible to show the screen shot of the script along with the stactrace of the error/exception that you get?