mysql -how can we store Testng results to database

2.1k views Asked by At

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)?

1

There are 1 answers

0
peetya On

Create a custom Reporter Listener by extending the org.testng.TestListenerAdapter and override the onTestSuccess, onTestFailure and onTestSkipped methods 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:

http://testng.org/doc/documentation-main.html#testng-listeners

And here you can find how can you override the TestListenerAdapter:

http://testng.org/doc/documentation-main.html#logging-listeners