Testing Requirements
I have a number of web services that return a status code and an XML payload. For each of these web services, I would like to write tests that meet the following criteria:
- Test requirements
- Verify that the web service returns the correct status code based on the inputs (testWebserviceStatus)
- If the status code is correct, then I would like to verify 1 or more properties of the payload. Every property is independent, so I would like to have each property verification run as a separate test (testWebserviceProperties)
- Other requrements
- The ability to add/remove the list of web services to test and add/remove the list of properties to verify for each service without updating the test code.
- If testWebServiceStatus fails, then its associated testWebserviceProperties should be skipped
- The test report should clearly show the success failure of each testWebservice/testWebserviceProperty test along with the web service/property that was being tested
Continue reading “Using TestNG to write a Data-Driven test that depends on the output of another Data-Driven test”
Tags: data-driven testing, integration test, Junit, open source, TestNG, web service