Hi nmrao. Thanks for help. I tried with WsdlProjectPro. Now I'm getting null pointer exception while executing, Please find my code
public void test() {
final String testProjectFileNameStr = "C:\\Users\\akrishnan\\git\\automation\\";
ProxySelector.getDefault();
final WsdlProjectPro project = new WsdlProjectPro(testProjectFileNameStr);
final String name = project.getName();
System.out.println(name);
final WsdlTestSuitePro testSuite = (WsdlTestSuitePro) project.getTestSuiteByName("InitiateTransfer");
final int numOfTestCases = testSuite.getTestCaseCount();
System.out.println("Number Of Test Cases: " + numOfTestCases);
for (int i = 0; i < numOfTestCases; i++) {
testCase = (WsdlTestCasePro) testSuite.getTestCaseAt(i);
final String test = testCase.getName();
System.out.println(test);
final int numOfTestSteps = testCase.getTestStepCount();
System.out.println("Number of Test Steps: " + numOfTestSteps);
for (int j = 0; j < numOfTestSteps; j++) {
// String reasonStr = "";
final WsdlTestStep testStep = testCase.getTestStepAt(j);
final String testStepNameStr = testStep.getName();
final int countSteps = j + 1;
System.out.println(countSteps);
// KSU.testStepsOut(countSteps, testStepNameStr);
final WsdlTestCaseRunner testRunner = new WsdlTestCaseRunner(testCase, null);
soapResult = testRunner.runTestStepByName(testStepNameStr);
final Status result = testRunner.getStatus();
final String resultStr = result.toString();
System.out.println(resultStr);
}
}
}
In the above code snippet, I'm getting null pointer in final WsdlTestCaseRunner testRunner = new WsdlTestCaseRunner(testCase, null);
Can we use WsdlTestCaseRunner to run the case or we have to use something else specifically for soapui-pro?
FAILED: test
java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.checkSaveMetrics(WsdlTestCaseRunner.java:84)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.<init>(WsdlTestCaseRunner.java:36)
at com.interac.oas.payments.SoapRunner.test(SoapRunner.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)