corki
16 years agoContributor
Unknown ERROR with RUNNING "Groovy Script" type testStep
Hello all,
Can someone please explain me what is wrong with method : testStep.run ( testRunner, context );
That "run" method makes me trouble all f.. day. I wrote it foolowing way and ALWAYS brings me ONE ERROR, but the code works and the groovy step has been executed properly. Everythings has gone find, but still that error appears :
---------------------------------------
Error:
14:18:55,328 ERROR [SoapUI] An error occured [java.lang.NullPointerException], see error log for details
java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156)
at FirstClass.main(FirstClass.java:129)
----------------------------------------------------------
My Code :
WsdlProject project = new WsdlProject( "C:/......./soapui-project.xml", "" );
WsdlTestSuite testSuite = project.getTestSuiteByName("1 - Get_Categories");
WsdlTestCase testCase = testSuite.getTestCaseByName("1.1.1 - GetCategories_All");
WsdlTestStep testStep = testCase.getTestStepByName("GetCategories_All");
WsdlTestRunContext context = new WsdlTestRunContext( testStep );
for(int i=0; i
if(testCase.getTestStepAt(i).getModelItem().toString().indexOf("WsdlGroovyScriptTestStep") >= 0 ) {
System.out.println("Found a Groovy Script before this step.");
// run this groovy script
WsdlTestRunContext i_context = new WsdlTestRunContext( testCase.getTestStepAt(i) );
testCase.getTestStepAt(i).run(i_context.getTestRunner(), i_context);
}
}
Can someone please explain me what is wrong with method : testStep.run ( testRunner, context );
That "run" method makes me trouble all f.. day. I wrote it foolowing way and ALWAYS brings me ONE ERROR, but the code works and the groovy step has been executed properly. Everythings has gone find, but still that error appears :
---------------------------------------
Error:
14:18:55,328 ERROR [SoapUI] An error occured [java.lang.NullPointerException], see error log for details
java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156)
at FirstClass.main(FirstClass.java:129)
----------------------------------------------------------
My Code :
WsdlProject project = new WsdlProject( "C:/......./soapui-project.xml", "" );
WsdlTestSuite testSuite = project.getTestSuiteByName("1 - Get_Categories");
WsdlTestCase testCase = testSuite.getTestCaseByName("1.1.1 - GetCategories_All");
WsdlTestStep testStep = testCase.getTestStepByName("GetCategories_All");
WsdlTestRunContext context = new WsdlTestRunContext( testStep );
for(int i=0; i
if(testCase.getTestStepAt(i).getModelItem().toString().indexOf("WsdlGroovyScriptTestStep") >= 0 ) {
System.out.println("Found a Groovy Script before this step.");
// run this groovy script
WsdlTestRunContext i_context = new WsdlTestRunContext( testCase.getTestStepAt(i) );
testCase.getTestStepAt(i).run(i_context.getTestRunner(), i_context);
}
}