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

File.PNG

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

ProjectName.PNG

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

Project.PNG

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

All IT Courses 50% Off
src.PNG

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

packagename.PNG

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

pkg.PNG

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

Class.PNG

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.

TestA.PNG

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

TestA1.PNG

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

TestB.PNG

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

Properties.PNG

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

Libraries.PNG

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

TestNG.PNG

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