Forum Discussion
The setUp script of the suite is executed when the test suite is launched. Similarly a test case setUp script is started when a test case is started. So if you launch the test case or a test step, the test suite setuUp script is not executed.
If you open the setUp script (via test suite editor), you can execute the setUp script manually (by the green arrow button). If you want to do the same with scripting, you can use the API:
testSuite.runSetupScript(context, runner)
I suggest either to launch the whole test suite or to use a more suitable place where to put the script (on test case level, Groovy script test step or other option).
- ankush9 years agoOccasional Contributor
Thanks, that helps.
Could you please let me know how to set context and runner arguments here ?
- nmrao9 years agoChampion Level 3
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
Related Content
Recent Discussions
- 15 years ago