Forum Discussion

arunbharath's avatar
4 years ago

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.

18 Replies

  • nmrao's avatar
    Champion Level 3
    When it is possible to execute the tests using testrunner.bat (.sh) utility of READYAPI_HOME/bin, what are you trying to achieve by writing java? Just trying to understand what testrunner can't do and that is achieved by your program.
    • arunbharath's avatar

      nmrao  Thanks for you response.

      I've got a UI testing scenarios for that I need values from the API response. I used TestNG  framework with java to achieve the UI automation (I know readyAPI supports selenium,, but My case needs a lot of classes, so TestNG is better compared to readyAPI, I believe). So to achieve that, I have to run readyAPI through java and get the response values. I already worked on this by using soapUI, I'm able to achieve that. But when comes to readyAPI, I'm not getting proper documentation for java integration. Any inputs is appreciated.