Reg: Unable to run my Groovy script from Jenkins.
Hi,
I am unable run my Groovy script from Jenkins. Jenkins Groovy script is unable to resolve imported classes. I have copied the Jar file in ..../<groovy home dir>/lib, ..../jre/lib, ..../<groovy home dir>/bin, ..../jdk/bin, ...../Jenkins/jre/lib and in ....Jenkins/jobs/<my job> folders. Nothing worked. I was able to import other jar files by copying it in .....\Jenkins\jre\lib folder. But, this particular jar is not recognized by Jenkin's Groovy script. And, I am able to run same code using IntelliJ tool using Groovy script, without making any changes.
Sample Code:
------------
import SoapUITools.SUIT
ServiceEndpoint = SUIT.GetServiceEndpoint("56", "73") // GetServiceEndpoint contains a call to Web service that is hosted on different system
Syntax Error in Jenkins Groovy script:
------------------------
startup failed:
Script1.groovy: 2: unable to resolve class SoapUITools.SUIT
@ line 2, column 1.
import SoapUITools.SUIT
I tried, import SoapUITools.*, but did not work.
Any help would be appreciated,
Thanks
Hi SumitM,
By default, ReadyAPI uses script libraries from the <ReadyAPI installation>\bin\scripts folder: https://support.smartbear.com/readyapi/docs/testing/scripts/library.html
If you run your tests in Jenkins using the default soapui-settings.xml file, testRunner will search for scripts in the <ReadyAPI installation>\bin\scripts folder on the machine where you run your tests.
If you have jar files which you need to use, these files should be placed in the <ReadyAPI installation>\bin\ext folder on the machine where you run your tests.