Selenium Framework for Beginners 27 | TestNG How to Rerun (Retry) Failed tests | Selenium Framework

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 62

  • @ayushbansal7860
    @ayushbansal7860 6 років тому +1

    Hi Raghav!! It was a very good concept and you explained it really well. Thank you for all the effort and hardwork that you put in. It helps us a lot. Keep up the good work, you are doing great.

    • @RaghavPal
      @RaghavPal  6 років тому

      You're welcome Ayush. Thanks for the message.

  • @revanthsivanantham6571
    @revanthsivanantham6571 3 роки тому

    Thanks Raghav for making wonderful videos.

    • @RaghavPal
      @RaghavPal  3 роки тому

      Glad you like them Revanth

  • @keshavdwivedi5192
    @keshavdwivedi5192 6 років тому

    Very nice raghav I was not able to figure out a definite way to re run testng test your series is very valuable for me

    • @RaghavPal
      @RaghavPal  6 років тому

      Glad to know this Keshav. All the best.

    • @keshavdwivedi5192
      @keshavdwivedi5192 6 років тому

      Thank you raghav, I am stuck in nullpointer issue in cucumber can u help me can I share the code over email ??

    • @RaghavPal
      @RaghavPal  6 років тому

      Hi Keshav, I will check in some time

  • @sankararaojeeru4333
    @sankararaojeeru4333 2 роки тому

    Thank you so much sir, such a wonderful explanation.

  • @ganeshnakkala7106
    @ganeshnakkala7106 3 роки тому

    Nice Explanation Thank you Raghav

    • @RaghavPal
      @RaghavPal  3 роки тому

      You're most welcome Ganesh

  • @asifshaik1038
    @asifshaik1038 3 роки тому +2

    Hi Raghav Sir,
    We need to mention 'retryAnalyzer' under every @Test annotation?
    Suppose I have 1000 TCs then 1000 times I need to give retryAnalyzer?

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hi Asif, you can use it at run time (Using Retry Class with ITestAnnotationTransformer Interface) medium.com/@sonaldwivedi/how-to-rerun-only-failed-testcases-using-testng-a23802f6884

    • @asifshaik1038
      @asifshaik1038 3 роки тому

      @@RaghavPal Thank you Sir :)

  • @jitendrasawant3872
    @jitendrasawant3872 3 роки тому

    Thank you for this information knowledge

  • @manoharch1203
    @manoharch1203 3 роки тому

    Nice Explanation,Thanks Raghav :)

    • @RaghavPal
      @RaghavPal  3 роки тому

      You're most welcome Manohar

  • @monushh
    @monushh 2 роки тому +1

    Hi Raghav, very well explained the concept of rerun failed tests. A qq- in your example you showed how to retry failed tests (in the same class) by re-running the auto-generated testng-failed.xml file manually. I am assuming when the tests fail from multiple classes then the xml will reflect the failed tests in their corresponding class tags in the auto-generated xml? Or is this assumption incorrect?

    • @RaghavPal
      @RaghavPal  2 роки тому +1

      Hi Mohan, it will be based on your testng.xml, if you are running multiple classes it will reflect as you have mentioned in the file, Can do a try

    • @monushh
      @monushh 2 роки тому

      @@RaghavPal Thank you very much!

  • @rithwikreddye
    @rithwikreddye 3 роки тому

    Hi Raghav,
    Are there any prerequisites to be followed because I’m unable to find test-failed.xml in my test-output folder even after test cases being failed when I run my test suite

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hope you are running as TestNG suite, Check all the setup, and also try to change ver of TestNG

  • @UltimateCodingGuide
    @UltimateCodingGuide Рік тому

    If any testcase failed and that testcases need to run alone with passed ...like failed testcase can not run alone do in case how to work with

    • @RaghavPal
      @RaghavPal  Рік тому +1

      Hi Rushieksh
      Here are the steps on how to run failed test cases in TestNG:
      1. Create a new TestNG suite file.
      2. In the suite file, add the following configuration:
      Code snippet
      failed


      The groups element specifies the groups of tests that should be run. In this case, the failed group will be run.
      The classes element specifies the classes that should be run. In this case, the com.mycompany.myproject.FailedTests class will be run.
      3. Run the suite file.
      The suite file will run the failed tests in the com.mycompany.myproject.FailedTests class.
      Here are some additional things to keep in mind:
      * The failed group is a predefined group in TestNG. It contains all of the tests that have failed in previous runs.
      * You can also specify your own groups of tests to run.
      * You can run multiple groups of tests in the same suite file.
      I hope this helps

    • @UltimateCodingGuide
      @UltimateCodingGuide Рік тому

      @@RaghavPal thankyou sir ❤️

  • @akashbhatt3223
    @akashbhatt3223 4 роки тому

    Hi Raghav.Thank you for the video.I have one question ,If I want to parameterize the failed test cases by passing testfailed.xml from test output directory in choice parameter in Jenkins,how we can acheive it ? as these folders will be deleted when we run the command "mvn clean". Kindly suggest.

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Hi Akash, you can configure it maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html

    • @akashbhatt3223
      @akashbhatt3223 4 роки тому

      @@RaghavPal ...Thank you Raghav.

  • @Nmx7428
    @Nmx7428 2 роки тому

    Thanks

  • @utpalkundu
    @utpalkundu 6 років тому

    Thanks a lot Raghav..you really explain very well and to the point... God job... Keep it up...could you please make some videos in Advanced Cucumber topics..

    • @RaghavPal
      @RaghavPal  6 років тому

      sure Utpal, i will do that soon

  • @radhavignesh
    @radhavignesh 6 років тому

    Hello Raghav, Thanks !. In this case we know the testcase3 will fail and want to retry that particular one. If we dont know which one will fail and want to do rerun the someother case that fails?.

    • @RaghavPal
      @RaghavPal  6 років тому

      Hi Radha, this is exactly the point of using testng to rerun any failed tests. So all the failed tests info will go to testng-failed.xml and you will just need to run this file. This is shown in the video

    • @xxxjovit
      @xxxjovit 4 роки тому

      @@RaghavPal, By the way , good tutorial. But I was expecting the tutorial for automatically identify the failed tests and re-run it automatically. If 50 test fails, it is waste of time to writing the retry code in every failed test cases.

  • @shipinpk706
    @shipinpk706 4 роки тому

    Hi
    I am trying to retry the failed test cases in selenium, but when retry the failed testcases the faker input will be same. So my test cases will not execute. Why its happen? Is there any solution?

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Shipin, I will need more details on your scenario. pls check if something like this will help you - github.com/cbeust/testng/issues/1166

  • @arunkumarr6614
    @arunkumarr6614 4 роки тому

    Hi raghav, is there a way to do retry with a slow browser speed? As you know firefox is running fast and i want to run it slow for failed testcases. can you please help me?

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Arun, will have to check this online

  • @sadhgurusathi7294
    @sadhgurusathi7294 5 років тому

    Accordingly Yours , which one of the above 'rerun failed test' method is the best for big project bro??

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Santosh, usually when you are running during off hours, you can leverage command line mode for rerunning failed test cases

    • @sadhgurusathi7294
      @sadhgurusathi7294 5 років тому

      @@RaghavPal Thanks for making time to reply..

  • @ajitkumarmahapatra9116
    @ajitkumarmahapatra9116 3 роки тому

    please demonstrate one scenario for rerun failed tests in Automated way.

    • @RaghavPal
      @RaghavPal  3 роки тому +1

      I will plan Ajit

    • @ajitkumarmahapatra9116
      @ajitkumarmahapatra9116 3 роки тому

      @@RaghavPal thanks bro..a lot.
      Scenario:I need to create multiple class having multiple @Test (tc's).then create a .xml to run the total suite through cmd and finally rerun the failed tc's through cmd using testng-failed .xml file .which one we told on mentioned video(automated way of rerun of failed scenario)but not demonstrate.please help .

    • @RaghavPal
      @RaghavPal  3 роки тому

      you can do this through testng.xml, check the videos on that

  • @dheerajsingh6568
    @dheerajsingh6568 6 років тому

    Super duper mast bhai...... Can you please shows me the real example of this retry coz I did try to use the real example but it execute only one time :(... Please help me

    • @RaghavPal
      @RaghavPal  6 років тому

      Hi Dheeraj, let me know the issue/error you faced. It should work fine if configured correclty.

  • @muaazster
    @muaazster 3 роки тому

    if retry , will Testng reports get override ,

    • @RaghavPal
      @RaghavPal  3 роки тому +1

      No it will create new one

  • @kundansharma6536
    @kundansharma6536 3 роки тому

    Is it possible to repeat failed steps?

  • @faisalsakib9586
    @faisalsakib9586 5 років тому

    How would we know which one is going to b failed when we were not in office

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Faisal, we do not know what will fail and thats the reason, we are making all failed tests re-run. On the second attempt there are good chances that we may get most the failures again, but this is to run the failed tests again, so just in case some tests failed due to non-fucntional/environment related issues, like network and if in the second run that is resolved, we may get some pass and will have to invest less time in troubleshooting.

    • @jothisubramanian5327
      @jothisubramanian5327 4 роки тому

      Tgg

  • @johnkim2212
    @johnkim2212 3 роки тому

    How to connect you ? You have an email ?

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hi John, can email here learnwithraghav@gmail.com