Forum Discussion
Hi,
In this case and based on the following assumptions from your question...
- The assertion is the same for every step
- Each step is within a single test case
- I do not want to update each step to add the same assertion and that would be a pain.
I would add a single groovy script as the last step in the test case. The Groovy script would iterate over each test step and then check the values of interest.
Luckily, some SmartBear people and contributors have been writing some guides. https://community.smartbear.com/t5/Technical-Articles/tkb-p/readyapi-community-techarticles
There is one you might find especially useful... https://community.smartbear.com/t5/Technical-Articles/How-to-capture-teststep-status-as-pass-fail-using-groovy-to/ta-p/223362. This at least will guide in you in how to iterate over the test steps, but it mentions assertion status, which you won't have because you have not applied to the assertion to each.
Another approach... It looks like you're calling the same service lots of times with different payloads. You might want to look up data-driven tests whereby for each row in some datasource, you call the same service in a loop but the values change for each row. If that's the case, then you only need one webservice call and therefore, only one assertion to apply.
Hi Chris,
Thanks a lot for your response but I would really appreciate if you could help me to write the actual script as I am not a dev and I wouldn't be able.
Here the info:
SOAPUI project: STS_CompanyRetrieval
SOAPUI TestSuite: Request_ErrorManagement
Thanks a lot!
Nadia
- ChrisAdams3 years agoChampion Level 3
Hi,
I'm happy to help, but not to build your solution from scratch. Take a look at the guides and have a go then post what you've come up with and there are plenty of people who can help.
What ever I/we provide is not likely to be perfect as we don't have access to the API you're calling, so even if I did provide something from scratch you would probably need to amend it.
It's probably worth re-reading my earlier post to think about which approach you'd prefer. For example, if you have the Pro licensed version, then I would definitely recommend the data-driven approach. If you're using the free open-source version, then I'd suggest running the checks in the test tear-down (https://support.smartbear.com/readyapi/docs/functional/scripts.html)
You don't have to be a dev to write some Groovy script and if you are moving into API development, then now is a great opportunity to learn some scripting and call on here for help.
Related Content
Recent Discussions
- 4 days agoemoya