The groovy scripts which are present under project.xml does find all jars to be imported which are present
I pulled out common functions and built a seperate script library and placed it outside the project xml, and call those methods from a groovy script present inside project.xml: the dependenices could not be imported.
INFO [SoapUI] Adding [/***/jenkins/home/workspace/******Regression_Maven/***soapui-integration/ext/xyz.jar] to extensions classpath
All those jars are required seperately are present in the workspace, but the seperate groovy script is unable to find it.
file:/***/jenkins/home/workspace/*****-Regression_Maven/****-soapui/****-soapui-projects/Regression_****/groovy-lib/***/Create***.groovy: 7: unable to resolve class xyz.xyzUtility @ line 7, column 1. import xyz.xyzUtility
Any suggession would be highly appreciated.
You need to copy the libraries to the <ReadyAPI installation>/bin/scripts folder on the Jenkins node. To copy the files, you can use the Jenkins Copy file build step. A possible alternative is to place the project and data file to some shared network folder to which Jenkins nodes have access.
Thank you a lot Nastya!
@apattanayak please let us know if this helped.
@Nastya_Khovrina Thank you very much for your reply. Sorry for late reply. This does not help, I think, I might have raised the question under SOAP UI pro, instead of cummunity edtition.
Let me try to elaborate more, we use soap ui community version, until now it has worked fine. In jenkins, for all of our internal Jars, we use 'Additional classpath' under 'build environment' step. So, the groovy scripts which are present under multiple projectX.xml, do find the related dependencies properly.
As soon as, there is an independent groovy script, which is outside the project xml, can not find those dependencies. Any lead would be highly appreaciated.
I'm sorry, but I don't fully understand this statement:
"As soon as, there is an independent groovy script, which is outside the project xml, can not find those dependencies."
Can you please provide more details about your configuration and errors that you get?
Hi @Nastya_Khovrina , sorry for late response.
in my local drive directory structure looks like
Inside projectA, corresponding project.xml is present with multiple test cases. Each test case has some groovy scripts. In local machine, we manually copy the required dependency under this location C:\Program Files (x86)\SmartBear\SoapUI-5.4.0\lib and it works fine.
I added a seperate groovy script under test-automation/groovy-lib/ . I call this script from the test cases present under test-automation/xxx/ProjectA.
In jenkins, whenGroovy script which is present under project.xml, it finds all the dependency(common groovy lib and also in house jars). And In jenkins, for all of our internal Jars, we use 'Additional classpath' under 'build environment' step. They work all fine.
From the test case, the groovy script CreateUser.groovy is getting called, this is present under test-automation/groovy-lib/ does not find the related dependency. But when that script is present under test-automation/xxx/ProjectA/ProjectA.xml it finds all the dependencies.
Any suggestion would be highly appreciated. Thank you.