Forum Discussion

zaheer2308's avatar
2 years ago

Rerun failed test from mvn command line.

Hi All,

This is what I am search from last 2 weeks and none of the solution on internet worked for me. 


I have junit+selenium+cucumber project. for that I have 2 class ( and for test runs. Upon running tests, rerun.txt file generates under 'target' folder which is expected. Now, I want to have command to execute only rerun.txt or cases listed under this file. I have tried options like 

mvn clean verify  -Dcucumber.options="@target/rerun.txt"

but these doesn't work, If I use this it automatically runs all the tests from all the available feature files. 


to give better perspective, here is my runner class:

features = {"src/test/resources/com/brillio/feature/"},
glue = {"com/brillio/stepdefinition", "com/brillio/apphooks"},
tags = "",
plugin = {"pretty","com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:", "rerun:target/rerun.txt"}

public class TestRunner {



here is my failedrun class



//features = {"src/test/resources/AppFeatures/AccountsPage.feature"},
features = {"@target/rerun.txt"},
glue = {"com/brillio/stepDefination", "com/brillio/appHooks"},
plugin = {"pretty","com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",



@CucumberOptions(plugin={"rerun:failedrerun.txt", "com.trulia.infra.WebDriverInitFormatter",

public class FailedRun {



Thanks in advance.

No RepliesBe the first to reply