Forum Discussion
Redde,
Good day. I am not getting the test suite level requests and responses. As I mentioned earlier , it is running only for 1st test case and 1st test step. Could you please look into the code in my previous reply.
Thanks,
Hi,
Have another look at PrathapR reply, he mentions....
Note: It will work perfectly, if all test steps are REST Requests , if testcases have any other steps(EX:Groovy script, data source, data source loop, etc..) it might throw error, because code looks for request and response of each test step. If we have any other steps have to handle with test step type condition.
Your error is what PrathapR warned about...
No signature of method: com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.getTestRequest() is applicable for argument types: () values: []]
You can easily work out what the class is. Here is an isolated example that runs through a test suite that prints what type the step is and then a message indicating whether it is a step you want to write (or not).
testSuite.testCaseList.each {
it.testStepList.each {
log.info(it.toString()); // This shows us the class name of the step.
if (it.toString().contains("wsdl.teststeps.WsdlTestRequestStep")){
log.info("Got a test request. Write this one down");
// Do your stuff here.....
} else {
log.info("Not a test request step, ignore....");
}
}
}
In short, you're not far off. Look at the above then see where to apply the 'if' in your script.
- ChrisA4 years agoContributor
Hi,
Maybe for your purposes, you need to test whether the step is 'RestTestRequestStep'. I knocked up the example in a SOAP, not REST project. I think 'RestTestRequestStep' are the ones you're looking for.
As for property transfer steps, I've never used them, but I don't think they are typical request/response like steps. They just help the test 'move' values from one step to another.
- Sirisha20204 years agoContributor
Hi Chris,
Thanks for your help on this. I ran the below script. I am getting below response in script log:
- Mon Oct 26 07:56:49 EDT 2020:INFO:com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep@2a51a550
- Mon Oct 26 07:56:49 EDT 2020:INFO:Not a test request step, ignore....
- Mon Oct 26 07:56:49 EDT 2020:INFO:com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep@39d045f1
- Mon Oct 26 07:56:49 EDT 2020:INFO:Not a test request step, ignore....
- Mon Oct 26 07:56:49 EDT 2020:INFO:com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep@4719db1
- Mon Oct 26 07:56:49 EDT 2020:INFO:Not a test request step, ignore....
- Is there any way to get the request and response for Property Transfers test step. We have dependency on this test step to proceed further.
- Thanks a lot Chris and Redde for helping me on this.
Related Content
- 6 months agoLearner_Pranavi