arunbharath
6 years agoContributor
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
runner.setProjectFile("C://Work//sampleproject.xml");
// 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
runner.setJUnitReport(true);
// Command the runner to create printable report
runner.setPrintReport(true);
// Command the runner to open the created report
runner.setOpenReport(true);
// Specify the folder to save the report in
runner.setOutputFolder("C:\\Users\\mwl\\tmp");
// Start the test run
runner.run();
}
// Handle the exception, if any
catch (final Exception e) {
e.printStackTrace();
}
}Above is the code. I have used to execute the test cases. any help would be appreciated.