All IT Courses 50% Off
Selenium Tutorials

How to Execute Failed Test Cases in TestNG using Selenium WebDriver

In this article, we learn how to execute failed test cases in TestNG by using Selenium WebDriver

I. Create a Selenium ProjectStep 1: Launch the Eclipse and Create a New Java project by clicking File > New > Java Project


Step 2: Enter Project Name > Choose execution environment > Select Project layout option > Click on the Finish button.


When you click on the finish button the “ProjectTest” java project is created and looks like


Step 3: Expand the newly created project. You will able to see the “src” folder. Right-Click on src folder > Select New > Click Package


Step 4: In this step, enter the Package Name and click on the Finish button.


After clicking on “finish” button the project structure will look like


Step 5: Right-click on the newly created package and select New > Select Class.


Step 6: In this step,

  1. Enter the “class” name
  2. Select modifiers
  3. Browse and select superclass java.lang.object
  4. Click on the finish button.

Here, you are creating two classes ex: TestA, TestB.

First Create Class TestA.


When you click on the “Finish” button it will create a class like:


Similarly, create a class TestB. When you click on the “Finish” Button class will look like:


Step 7: To Execute Failed Test Cases If you have installed the TestNG library just click on Java Project and select >Properties.


Step 8: In the properties window, click on Java Build Path > Click on Libraries > Click on Add Library.


Click on “TestNg” and Click on the “Next” button.


Then click on the “Finish” button.

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Articles

Back to top button

Get Selenium Training Online
Course Now at 50%OFF!

Offer valid for 1st 20 seats only, Hurry up!!

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

H2kinfosys will use this information to be in touch with you for providing updates.