run testcase from different testsuite from CLI
I have a test suite that contains a testcase called Send Results. It sends the results of the test case that calls it and write those results into our test case repo execution cycle. All the testsuite/cases live in the same project. When I run this in readyAPI it works fine. When I run it via the CLI I get a null pointer exection on the getProjectByName().
ERROR [SoapUI] An error occurred [Cannot invoke method getProjectByName() on null object], see error log for details
ERROR [errorlog] An error occurred in the script of the Groovy Script test step [Send Result]:
ERROR [errorlog] java.lang.NullPointerException: Cannot invoke method getProjectByName() on null object
I understand why I get this error when running via the CLI but I don't understand how to correct it. How can I make it so that the testcases can call the getProjectByName and access the desired testcase.
Code for calling the testcase:
testCase = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("EL-Web").getTestSuiteByName("Zephyr").getTestCaseByName("Set-TestCaseStatus")
def runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)