Forum Discussion
Thanks, that helps.
Could you please let me know how to set context and runner arguments here ?
In the test suite setup both variables are available.
Like KarelHusa rightly suggested, please the execute test case / suite appropriately.
- ankush9 years agoOccasional Contributor
Hi,
Can't seem to get around this:
com.eviware.soapui.SoapUI.setSoapUICore(new StandaloneSoapUICore(true));
WsdlProject project = new WsdlProject(path);
suiteList = project.getTestSuiteList();
TestSuite suite = suiteList.get(0);
//run the set up script
TestSuiteRunContext context = null;
TestSuiteRunner testSuiteRunner = null;
try {
System.out.println("-- run setup script");
((WsdlTestSuite) suite).runSetupScript(context, testSuiteRunner);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("Error from run setup script");
e.printStackTrace();
}
how do I initialize the following :
TestSuiteRunContext context
TestSuiteRunner testSuiteRunner
- KarelHusa9 years agoChampion Level 1
You can use the following code:
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner import com.eviware.soapui.support.types.StringToObjectMap def suite = testRunner.testCase.testSuite def runner = new WsdlTestSuiteRunner(suite, new StringToObjectMap()) suite.runSetupScript(runner.getRunContext(), runner)
Please consider that executing a test suite script from its test cases or test steps is not a standard way of using it. You may need to prevent multiple executions when running the test suite etc.
- ankush9 years agoOccasional Contributor
The solution you mentioned works when as groovy test step.
I am looking for something which I can execute from java.
Also I get following error message when I try to use
WsdlTestSuiteRunner testSuiteRunner = new WsdlTestSuiteRunner((WsdlTestSuite) suite, new StringToObjectMap());
((WsdlTestSuite) suite).runSetupScript(testSuiteRunner.getRunContext(), testSuiteRunner);
"The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files"
Related Content
- 2 years ago
Recent Discussions
- 15 years ago