TestNG- Results are overwritten after every run

467 Views Asked by At

I am very new to java & TestNG . I did a java-selenium POC concept where the test script executes well but the results are overwritten after every run. I managed to add a timestamp for the screenshot for failed but could not do that to emailable result html file. So every time i run i loose the previous results.

I came across couple of similar questions but they didn't help me.

Should I add something in my - POM dependencies or should i include any code in my testng.xml file or should I create a separate class file with dome code that will do the operation .

Help appreciated

1

There are 1 best solutions below

0
On

Here what I can suggest you is create a script that could rename the emailable result html file and move the emailable report at some other location(it may happen that clean goal could delete the older reports in the project). Then create a profile in pom.xml for it and whenever you execute the maven goals then you just have to add -P<profile_name> and during every.

Second suggestion that I can give you is use IReporter listener of testng in order to create your custom emailable report and with the help of that you can even control the name of html file. Please let me know if you need some more information.