currently working with a very large application to test (several custom programs, running in a distributed environment), and has built up a very large set of automated test cases for regression and feature testing. These tests are large and there are a lot, so full test runs are dispatched across many machines, the results gathered, and then imported into a custom web app.
technologies: java/selenium/ant/testng/jenkins
reports: testng,reportng,xslt
how to store results in database(eg: mysql)?
Create a custom Reporter Listener by extending the
org.testng.TestListenerAdapterand override theonTestSuccess,onTestFailureandonTestSkippedmethods and log the results of the tests there to mySQL. After that you have to add your custom Reporter as a Listener.You can find on the TestNG's website, how can you define a custom Listener:
And here you can find how can you override the
TestListenerAdapter: