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

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 62

  • @ayushbansal7860
    @ayushbansal7860 5 лет назад +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  5 лет назад

      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

  • @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 :)

  • @sankararaojeeru4333
    @sankararaojeeru4333 2 года назад

    Thank you so much sir, such a wonderful explanation.

  • @Nmx7428
    @Nmx7428 2 года назад

    Thanks

    • @RaghavPal
      @RaghavPal  2 года назад +1

      Most Welcome Niket

  • @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

  • @jitendrasawant3872
    @jitendrasawant3872 3 года назад

    Thank you for this information knowledge

    • @RaghavPal
      @RaghavPal  3 года назад

      Most welcome Jitendra

  • @ganeshnakkala7106
    @ganeshnakkala7106 3 года назад

    Nice Explanation Thank you Raghav

    • @RaghavPal
      @RaghavPal  3 года назад

      You're most welcome Ganesh

  • @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!

  • @manoharch1203
    @manoharch1203 3 года назад

    Nice Explanation,Thanks Raghav :)

    • @RaghavPal
      @RaghavPal  3 года назад

      You're most welcome Manohar

  • @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

  • @rithwikreddye
    @rithwikreddye 2 года назад

    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  2 года назад

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

  • @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

  • @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.

  • @ajitkumarmahapatra9116
    @ajitkumarmahapatra9116 2 года назад

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

    • @RaghavPal
      @RaghavPal  2 года назад +1

      I will plan Ajit

    • @ajitkumarmahapatra9116
      @ajitkumarmahapatra9116 2 года назад

      @@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  2 года назад

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

  • @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

  • @akashbhatt3223
    @akashbhatt3223 3 года назад

    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  3 года назад +1

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

    • @akashbhatt3223
      @akashbhatt3223 3 года назад

      @@RaghavPal ...Thank you Raghav.

  • @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 ❤️

  • @radhavignesh
    @radhavignesh 5 лет назад

    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  5 лет назад

      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.

  • @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..

  • @muaazster
    @muaazster 2 года назад

    if retry , will Testng reports get override ,

    • @RaghavPal
      @RaghavPal  2 года назад +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 2 года назад

    How to connect you ? You have an email ?

    • @RaghavPal
      @RaghavPal  2 года назад

      Hi John, can email here learnwithraghav@gmail.com