Forum Discussion
I assume you only want REST test steps, so this would work:
import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep for (step in testRunner.testCase.getTestStepsOfType(RestTestRequestStep.class)) // do stuff
- codehaus9 years agoNew Contributor
after adding above script in to my groovy script, error is gone and create excel file but not write REST test step request/response into excel file.
any though?
- cmende9 years agoNew Contributor
How are you trying to write the request/response? I can see RestTestRequestStep#getTestRequest() that gives you a RestTestRequest object which you can use for further processing. The RestTestRequest also gives you AbstractHttpRequest#getResponse(), RestTestRequestStep#getResponseContentAsString() and RestRequest#getResponseContentAsXml() to get the response.
- codehausss9 years agoContributor
my script like this
import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep; for (test = 0; test < testSuite.getTestCaseCount(); test++) { suite = testSuite.getTestCaseAt(test); for (a = 0; a < suite.getTestStepCount(); a++) { b = suite.getTestStepAt(a); log.info b.getName(); for (step in testRunner.testCase.getTestStepsOfType(RestTestRequestStep.class)) { Label name = new Label(0, row, b.getName()); sheet.addCell(name); Label desc = new Label(1, row, b.getDescription()); sheet.addCell(desc); Label uri = new Label(2, row, getRequestURI(b)); sheet.addCell(uri); Label resp = new Label(4, row, b.getProperty("Response").getValue()); sheet.addCell(resp); row++; } } } workbook.write(); workbook.close();
i can see read every test step from the log.info and create the excel file.
but it only create excel file, doesn't write each test step into the excel row.
am i doing right here?
ps: i just lost my previous account, so please ignore my userid :)
Related Content
Recent Discussions
- 11 days ago