Forum Discussion

JackD's avatar
JackD
New Contributor
12 years ago

Using testcases from another testproject

Hi,

I am running several testprojects at night using Maven plugin/Jenkins.
One of the test projects (A) contains several jdbc requests for setting up the environment.
What I want to do is, in this nightly run, when a particular testproject (B, C, etc) starts, first call a testcase from testproject A in order to setup part of the environment.
I have created groovy scripts in testproject B etc (however, I am not an expert on this...):

//get test case from other project
project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName('testproject A')
testSuite = project.getTestSuiteByName('testsuite A.1');
testCase = testSuite.getTestCaseByName('testcase A.1.1');
// run test case
runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);
log.info runner

When I run soapUI GUI it works, but I have noticed that testproject A must be opened as well.

Is, what I want to achieve, possible (and how) in this nightly run?

Thanks for any help!
Jack
  • Hello,

    If you have placed the script in an event handler, that may be the issue. Some event handler don work with testRunner. There is currently a Feature request in place to add this as a feature in SoapUI(feature request tracking number: SOAP-1051) so that you will not have to use a script. This should make it work with testRunner.

    Regards,
    Temil