Rerun failed scenario in cucumber using second runner class Watch this video for consolidate the two cucumber report into single report.-- • PDF Report Generation...
I have 2 runner files- Test runner ( the original runner) and Uecond Runner( for rerunning the failed cases) but on cmd mvn install or mvn test it is picking up the Uecond Runner first. Plz suggest.
@Niraj Guptha, when i include these runner class in fail safe plugin it is only picking original runner TestRunner. class, but not TesrRunnerRerun.class . but Target1 folder is getting created. I am confused whether it is picking TestRunner Rerun or not my cucumber json is empty in Target1 folder
first check and test case is failing or not if it is failing then check the rerun.txt file is generating or not then check the scenario it is loggin into rerun.txt file.
Hello Sir When I give folder name in POM my tests are not running from maven..it runs only when I give one runner file.how to include multiple runner files in POM.xml ? Please help
Hi Niraj, in my framework scenarios run with tags and in failedtxt file it is with line no.so when 2nd runner file i run it gives inconsistent error that both tag and line can't be used together..issue is i can't remove either of them.any idea on this?
you can try --thucydides.info/docs/serenity-staging/#_retrying_failed_tests unit.retry.tests to true and max.retries to the number of times you want failed tests to be retried. If max.retries provided and junit.retry.tests=true, all method tests will be executed until first successful run, but not more than 1 + max.retries times.
Hi Niraj, I am executing both runner and then failed rerunner class using TestNG one after the other in single execution. With this my extent report is getting Mixed up with failed scenarios from first run and the re executed scenarios from re-run. Is there any solution to remove failed scenarios if they got passed in second run from report and get clean report with no duplicates
In single Job we can't generate two report.Since report plugin are same.You can't add multiple report plugin in Jenkins.If you want to generate Through code then its possible
@@NirajGupta Yes I did it from code by adding two target folders, but i couldn't display those two reports as seperate in Jenkins. Anyways thanks for the explanation Niraj.
Hello Sir I have integrated rerun concept with jenkins. 1).my runner name is Runner 2).my rerun name is SecondRunner For some reasons my rerun file gets executed first then runner file is executed ...how can I make to run files normally ? My POM first I have mentioned Runner file then SecondRunner file
No need to rerun feature file to pom.xml.the runner class will generate rerun.txt file which you need to call in other runner class.So basically you will ill have two runner class first one will run your scenario according to tag or feature file path.then the second runner class will pickup the rerun.txt file and run the failed scenario
Hello Niraj, Thanks a lot for your such a good content, can you please share your lecture line where you have merged report of two diffrent class means How we can merge report of Rerun.txt and TestRun.java file
So if I understand it this solution is based on the runners name and the rerun runner has to be after the common runner class name? I need to run it automatically and I run runners separately. I can generate rerun.txt but my FailRunner does not run. :(
@@NirajGupta I have 4 runners, cause they run separately as suits. In pom.xml I have this fastTestCategory runners.FastRunner fullTestCategory runners.FullRunner TestCategory runners.TestRunner It means the Jenkins run mvn with category parameter which selects one of this profiles. I dont know how to run runners.FailedScenariosRunner created according this video.
Fiest check are you cleaning your work space before runing you each job.when you are generating failedrerun file don't put mvn clean install..just simply mvn install... clean will clear the target folder
@@NirajGupta I have the same problem, but it is because maven does not sort runners according the order in surefire . If I have ${category}, FailedTestsRunner* then FailedTestsRunner can be executed before runner in ${category} variable. Example in video sort runners alphabetically but I cant use it if I have category runner.
Hi sir, i can able to generate rerun.txt file and configured in TestRunnerRerun.java file also but,i cant able to generate target1 folder . can u plzz help me..
you need to mention report generation folder as target1 in side TestRunnerRerun.java @RunWith(Cucumber.class) @CucumberOptions(features = "@target/rerun.txt", plugin = { "pretty", "html:target1/cucumber-html-report", "json:target1/cucumber.json", "junit:target1/cucumber.xml" }, glue = { "com.automation" } ) public class ReRunTestRunner { }
@@NirajGupta @RunWith(Cucumber.class) @CucumberOptions( plugin = {"com.hpe.alm.octane.OctaneGherkinFormatter:gherkin-results/FailedTestRunner_OctaneGherkinResults.xml","rerun:target/failedfeatures.txt"}, features = {"@target/failedfeatures.txt"}, // points where exactly the failedfeatures.txt file is available glue = {"tpgqa.DAM.step_classes"}, // Steps location monochrome = true, // changes output window keep at true tags = {}, // tags target specific tests dryRun = false, // Boolean value, checks failure file(s) have matching steps definitions (True will just check for matching steps are available but will not execute // the code within the step file Reporting paths strict = true) public class X_FailedTestRunner_DAMAutomation { } @RunWith(Cucumber.class) @CucumberOptions( plugin = {"com.hpe.alm.octane.OctaneGherkinFormatter:gherkin-results/TestRunner_OctaneGherkinResults.xml","rerun:target/failedfeatures.txt"}, features = {"src/test/resources/test_plan_modules/Collections_portal/CK/System Validation/portal_GlobalCollection_Sort By Title-3015.feature"}, // points to the feature location glue = {"tpgqa.DAM.step_classes"}, // Steps location monochrome = true, // changes output window keep at true tags = {}, // tags target specific tests dryRun = false, // Boolean value, checks failure file(s) have matching steps definitions (True will just check for matching steps are available but will not execute // the code within the step file Reporting paths strict = true) public class TestRunner_DAMAutomation { } Kindly look in to this .