Dec 23 2011

Using TestNG to write a Data-Driven test that depends on the output of another Data-Driven test

Category: java,open source,testUlrich Palha @ 3:50 pm

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:

  1. Test requirements
    1. Verify that the web service returns the correct status code based on the inputs (testWebserviceStatus)
    2. 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)
  2. Other requrements
    1. 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.
    2. If testWebServiceStatus fails, then its associated testWebserviceProperties should be skipped
    3. 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: , , , , ,


Dec 09 2011

HTML Parsers and other libraries: don’t write your own till you know, and have tested, what already exists

Category: java,open sourceUlrich Palha @ 3:53 pm

It seemed simple…

I needed to extract some HTML content for one of the projects I was working on. It seemed easy enough to retrieve the content and parse out the title tag, so I quickly threw together the following code to retrieve the title tag. Continue reading “HTML Parsers and other libraries: don’t write your own till you know, and have tested, what already exists”

Tags: , , ,