How create a single test suite to support multiple environment with assertion
Hi all, I am new to API automation with ReadyAPI. Great if anyone could advice me on below scenario with the industry best practices.
I have a requirement to create an API regression test suite which will supports multiple environments(Dev, UAT, Pre-Prod etc).
My question is, is that possible to create a single test suite which can be executed in different environments with assertions according to the environment if not what is the best approach?
Ex: There is an API to retrieve person data. I want same to be executed in different environments and also assert the data based on the environment and also change the request data automatically when the environment is changed.
Thanks in advanced 🙂
Provide payload as below
resource=${#Project#RESOURCE} &client_id=${#Project#CLIENT_ID} &client_secret=${#Project#CLIENT_SECRET} &grant_type=client_crendentials
You can define property file as show below, and create a file for each enrionment.
dev.properties
RESOURCE=<dev-resource> CLIENT_ID=<dev-client-id> CLIENT_SECRET=<dev-client-secret>
And import the above file at project level, refer below documentation
https://www.soapui.org/scripting-properties/working-with-properties.html
So, you can similarly, use properties for END POINTS / other varying values per environment into property file and use them in the project as mentioned in the payload content.
Now all you need is single project, common test cases. No separate test suites / test cases per environment any more, just use appropriate property file, import them into project before running the tests.
If you are running the tests command line, even properties can be directly loaded runtime without even modifying the existing values in the project.