Ask a Question

How to get test step response in readyAPI using Java?


How to get test step response in readyAPI using Java?

Hi All.

     I'm trying to execute ReadyApi test cases from Java. I'm able to execute the test case but I could figure how to retrive the response from test step using java. I need couple of fields from the response to validate externally. Can anyone help me on this? I couldn't find any tutorial or support from the internet. 


		try {
			// Create a test runner object
			final SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();

			// Specify the path to the project file

			// Specify the test suite to run
			runner.setTestSuite("TestSuite 1");

			// Specify the test case to run
			// It must be in the test suite specified above
			runner.setTestCase("TestCase 1");

			// Run the test
			// Command the runner to create JUnit-style report

			// Command the runner to create printable report

			// Command the runner to open the created report

			// Specify the folder to save the report in

			// Start the test run;
		// Handle the exception, if any
		catch (final Exception e) {

Above is the code. I have used to execute the test cases. any help would be appreciated.


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\\";


		final WsdlProjectPro project = new WsdlProjectPro(testProjectFileNameStr);
		final String name = project.getName();

		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();


			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;
				// 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();



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
	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.checkSaveMetrics(
	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.<init>(
	at com.interac.oas.payments.SoapRunner.test(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.testng.internal.MethodInvocationHelper.invokeMethod(
	at org.testng.internal.Invoker.invokeMethod(
	at org.testng.internal.Invoker.invokeTestMethod(
	at org.testng.internal.Invoker.invokeTestMethods(
	at org.testng.internal.TestMethodWorker.invokeTestMethods(
	at org.testng.TestRunner.privateRun(
	at org.testng.SuiteRunner.runTest(
	at org.testng.SuiteRunner.runSequentially(
	at org.testng.SuiteRunner.privateRun(
	at org.testng.SuiteRunnerWorker.runSuite(
	at org.testng.TestNG.runSuitesSequentially(
	at org.testng.TestNG.runSuitesLocally(
	at org.testng.TestNG.runSuites(
	at org.testng.remote.RemoteTestNG.initAndRun(
	at org.testng.remote.RemoteTestNG.main(

Use pro api


Hi nmao.


    I'm not able to find pro api equalent to below steps. I checked Pro API guide, but I couldn't find anything. can you help me on this?

final WsdlTestCaseRunner testRunner = new WsdlTestCaseRunner(testCase, null);

				soapResult = testRunner.runTestStepByName(testStepNameStr);

Will check.

Even in the script, didn't happen to notice the integration between test step and selenium. Would you please point?


Hi nmrao. I wrote a separate class for the selenium and test step integration part. Here I'm trying to run readyAPI test cases and would like to receive the response of the each test step, I will pass those response as a JSON paramater to another class where I work on selenium with test data response as an input.

Any inputs on my issue? 

You better open a support case to find out the same.


have you tried ant because one of my colleage is also trying to do the same, and as per him he will create the project in soapui and execute the project via ant and ant will store the response into one notepad file from where he will read the response and validate on UI.


If you need more info then do let me know i will connect with him and will try to help you how he is doing.


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓

Thanks and Regards,
Himanshu Tayal
Showing results for 
Search instead for 
Did you mean: