Form above explanation it seems that -.xml gets deleted when you re- your tests in Post task under , because when you run “mvn clean” it will delete the target folder where failed-.xml was present.
To verify this you need to access the Jenkins workspace, but your software company might not have the access to it.

Further follow these steps they will solve the issue:

First your pom should be configurable to run the tests from command line:


Then configure jenkins for the Post build(which is you already doing) to run the failed-testng.xml.

But first you have to copy/move the failed-testng.xml to from target folder to any other folder within framework(except target and test-output folder, because these folders gets deleted when you run the command “mvn clean”).

Below is the Maven plugin to copy/move file from one location to another location:

        <!-- here the phase you need -->

Note: This plugin must be executed after the tests execution.

Source link


Please enter your comment!
Please enter your name here