Forum Discussion

Jasper175's avatar
Jasper175
Frequent Contributor
11 years ago

Call Test in Another XML

Here is a doozy,

Lets say under the Project Workspace I have TWO XML's
> XML-1
> XML-2

Has anyone found a way to run a test case, or better yet 'import' a groovy script code?

Thanks,
Rob

1 Reply

  • Jasper175's avatar
    Jasper175
    Frequent Contributor
    Ok - I found out how with other forums to "Call" or "GoTo" - here is the problem.

    I want to use another script (held in another XML) but apply the results to my running XML.


    Project-1
    Project-2

    When Running Project-2 I can use this code:

    project =testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("Code Reuse-1")
    testSuite = project.getTestSuiteByName("SETUP")
    testCase = testSuite.getTestCaseByName("Test_Selector")
    runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)
    runner.gotoStepByName("Enviornment_Selection_VIP")


    This calls my Environment Script (which houses all the host, db connect strings etc...)
    The problem is when it does run - it applies to "Project-1" properties - not my "Project-2"

    How can I get it to run, but apply the results to my Proejct-2 properties?