In the last few tutorials, we shed light on the basic and commonly used WebDriver commands. We also learned about the locating strategies of UI elements and their inclusion in the test scripts. Therefore, we developed our very first WebDriver Automation Test Script.
Moving ahead with this tutorial, we will discuss all about TestNG, its features, and its applications.
TestNG is an advanced framework designed in a way to leverage the benefits of both the developers and testers. For people already using JUnit, TestNG would seem no different with some advanced features. With the commencement of the frameworks, JUnit gained enormous popularity across Java applications, Java developers, and Java testers, with remarkably increasing code quality.
Table of Contents:
Using TestNG Framework For Selenium Script

See also => JUnit Tutorial and its usage in Selenium scripts
Despite being an easy-to-use and straightforward framework, JUnit has its limitations, which give rise to the need to bring TestNG into the picture. TestNG was created by an acclaimed programmer named as “Cedric Beust”. TestNG is an open-source framework that is distributed under the Apache Software License and is readily available for download.
Talking about our requirement to introduce TestNG with WebDriver is that it provides an efficient and effective test result format that can be shared with the stakeholders to have a glimpse of the product’s/application’s health eliminating the drawback of WebDriver’s incapability to generate test reports.
TestNG has an inbuilt exception-handling mechanism that lets the program run without terminating unexpectedly. Both TestNG and JUnit belong to the same family of Unit Frameworks, where TestNG is an extended version of JUnit and is more extensively used in the current testing era.
Features of TestNG
- Support for annotations.
- Support for parameterization.
- Advanced execution methodology that does not require test suites to be created.
- Support for Data Driven Testing using Data Providers.
- Enables users to set execution priorities for the test methods.
- Supports a threat-safe environment when executing multiple threads.
- Readily supports integration with various tools and plug-ins like build tools (Ant, Maven, etc.), and Integrated Development Environment (Eclipse).
- Facilitates users with an effective means of Report Generation using ReportNG.
Suggested Read =>> TestNG versus JUnit
TestNG offers multiple benefits that give it an edge over JUnit. Some of them are:
- Advanced and easy annotations.
- Execution patterns can be set.
- Concurrent execution of test scripts.
- Test case dependencies can be set.
Annotations are preceded by a “@” symbol in both TestNG and JUnit.
So now let us get started with the installation and implementation part.
TestNG Installation In Eclipse
Follow the below steps to TestNG Download and Installation on Eclipse:
Step #1: Launch Eclipse IDE -> Click on the Help option within the menu -> Select the “Eclipse Marketplace..” option within the dropdown.

Step #2: Enter the keyword “TestNG” in the search textbox and click on “Go” button as shown below.

Step #3: As soon as the user clicks on the “Go” button, the results matching the search string will be displayed. Now the user can click on the Install button to install TestNG.

Step #4: As soon as the user clicks on the Install button, the user is prompted with a window to confirm the installation. Click on the “Confirm” button.

Step #5: In the next step, the application will prompt you to accept the license and then click on the “Finish” button.
Step #6: The installation is initiated now and the progress can be seen:

We are advised to restart our eclipse to reflect the changes made.
Upon restart, a user can verify the TestNG installation by navigating to “Preferences” from the “Window” option in the menu bar. Refer to the following figure for the same.

(Click on image to view enlarged)

Creation of Sample TestNG Project
Let us begin with the creation of the TestNG project in Eclipse IDE.
Step #1: Click on the File option within the menu -> Click on New -> Select Java Project.

Step #2: Enter the project name as “DemoTestNG” and click on the “Next” button. As a concluding step, click on the “Finish” button, and your Java project is ready.

Step #3: The next step is to configure the TestNG library into the newly created Java project. For the same, click on the “Libraries” tab under Configure Build Path. Click on “Add library” as shown below.

Step #4: The user would be subjected to a dialogue box promoting him/her to select the library to be configured. Select TestNG and click on the “Next” button as shown below in the image. When you’re done, click the “Finish” button.

The TestNG is now added to the Java project, and the required libraries can be seen in the package explorer upon expanding the project.

Add all the downloaded Selenium libraries and jars in the project’s build path as illustrated in the previous tutorial.
Creating TestNG Class
Now that we have done all the basic setup to get started with the test script creation using TestNG. Let’s create a sample script using TestNG.
Step #1: Expand the “DemoTestNG” project and traverse to the “src” folder. Right-click on the “src” package and navigate to New -> Other.

Step #2: Expand the TestNG option and select the “TestNG” class option and click on the “Next” button.

Step #3: Furnish the required details as follows. Specify the Source folder, package name, and the TestNG class name and click on the Finish button. As it is evident from the below picture, the user can also check various TestNG notations that would be reflected in the test class schema. We will discuss TestNG annotations later in this session.

The above-mentioned TestNG class would be created with the default schema.

Now that we have created the basic foundation for the TestNG test script, let us now inject the actual test code. We are using the same code we used in the previous session.
Scenario:
- Launch the browser and open “gmail.com”.
- Verify the title of the page and print the verification result.
- Enter the username and Password.
- Click on the Sign in button.
- Close the web browser.
Code:
package TestNG;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class DemoTestNG {
public WebDriver driver = new FirefoxDriver();
String appUrl = "https://accounts.google.com";
@Test
public void gmailLogin() {
// launch the firefox browser and open the application url
driver.get("https://gmail.com");
// maximize the browser window
driver.manage().window().maximize();
// declare and initialize the variable to store the expected title of the webpage.
String expectedTitle = " Sign in - Google Accounts ";
// fetch the title of the web page and save it into a string variable
String actualTitle = driver.getTitle();
Assert.assertEquals(expectedTitle,actualTitle);
// enter a valid username in the email textbox
WebElement username = driver.findElement(By.id("Email"));
username.clear();
username.sendKeys("TestSelenium");
// enter a valid password in the password textbox
WebElement password = driver.findElement(By.id("Passwd"));
password.clear();
password.sendKeys("password123");
// click on the Sign in button
WebElement SignInButton = driver.findElement(By.id("signIn"));
SignInButton.click();
// close the web browser
driver.close();
}
}
Code Explanation with respect to TestNG
#1) @Test – @Test is one of the TestNG annotations. This annotation lets the program execution know that the method annotated as @Test is a test method. To use different TestNG annotations, we need to import the package “import org.testng.annotations.*”.
#2) There is no need of main() method while creating test scripts using TestNG. The program execution relies on annotations.
#3) In a statement, we used the Assert class while comparing the expected and the actual value. Assert class is used to perform various verifications. To use different assertions, we are required to import “import org.testng.Assert”.
Executing The TestNG Script
The TestNG test script can be executed in the following way:
=> Right click anywhere inside the class within the editor or the java class within the package explorer. Select the “Run As” option, and click on the “TestNG Test”.

TestNG result is displayed in two windows:
- Console Window
- TestNG Result Window
Refer to the below screen casts for the result windows:

(Click on image to view enlarged)

HTML Reports
TestNG comes with a great capability of generating user-readable and comprehensible HTML reports for test executions. These reports can be viewed in any of the browsers and it can also be viewed using Eclipse’s build–in browser support.
To generate the HTML report, follow the below steps:
Step #1: Execute the newly created TestNG class. Refresh the project containing the TestNG class by right-clicking on it and selecting the “Refresh” option.
Step #2: A folder named “test-output” shall be generated in the project at the “src” folder level. Expand the “test-output” folder and open the “emailable-report.html” file with the Eclipse browser. The HTML file displays the result of the recent execution.


Step #3: The HTML report shall be opened within the eclipse environment. Refer to the below image for the same.

Refresh the page to see the results for fresh executions, if any.
Setting Priority In TestNG
Code Snippet
package TestNG;
import org.testng.annotations.*;
public class SettingPriority {
@Test(priority=0)
public void method1() {
}
@Test(priority=1)
public void method2() {
}
@Test(priority=2)
public void method3() {
}
}
Code Walkthrough
If a test script is composed of more than one test method, the execution priority and sequence can be set using TestNG annotation “@Test” and by setting a value for the “priority” parameter.
Further Reading => Steps for Automating TestNG in Selenium
In the above code snippet, all the methods are annotated with the help @Test, and the priorities are set to 0, 1, and 2. Thus the order of execution in which the test methods would be executed is:
- Method1
- Method2
- Method3
Support for Annotations
Several annotations are provided in TestNG and JUnit. The subtle difference is that TestNG provides some more advance annotations to JUnit.
TestNG Annotations
Following is the list of the most useful and favorable annotations in TestNG:
| Annotation | Description |
|---|---|
| @Test | The annotation notifies the system that the method annotated as @Test is a test method |
| @BeforeSuite | The annotation notifies the system that the method annotated as @BeforeSuite must be executed before executing the tests in the entire suite |
| @AfterSuite | The annotation notifies the system that the method annotated as @AfterSuite must be executed after executing the tests in the entire suite |
| @BeforeTest | The annotation notifies the system that the method annotated as @BeforeTest must be executed before executing any test method within the same test class |
| @AfterTest | The annotation notifies the system that the method annotated as @AfterTest must be executed after executing any test method within the same test class |
| @BeforeClass | The annotation notifies the system that the method annotated as @BeforeClass must be executed before executing the first test method within the same test class |
| @AfterClass | The annotation notifies the system that the method annotated as @AfterClass must be executed after executing the last test method within the same test class |
| @BeforeMethod | The annotation notifies the system that the method annotated as @BeforeMethod must be executed before executing any and every test method within the same test class |
| @AfterMethod | The annotation notifies the system that the method annotated as @AfterMethod must be executed after executing any and every test method within the same test class |
| @BeforeGroups | The annotation notifies the system that the method annotated as @BeforeGroups is a configuration method that enlists a group and that must be executed before executing the first test method of the group |
| @AfterGroups | The annotation notifies the system that the method annotated as @AfterGroups is a configuration method that enlists a group and that must be executed after executing the last test method of the group |
Note: Many of the aforementioned annotations can be exercised in JUnit 3 and JUnit 4 frameworks as well.
Conclusion
Through this tutorial, we tried to familiarize you with a Java-based testing framework named TestNG. The session began with the installation of the framework, and then we proceeded with script creation and advanced topics. We discussed all the annotations provided by TestNG. We implemented and executed our first TestNG test script using annotations and assert statements.
Article Summary:
- TestNG is an advanced framework designed in a way to leverage the benefits by both the developers and testers.
- TestNG is an open-source framework that is distributed under the Apache Software License and is readily available for download.
- TestNG is considered to be superior to JUnit because of its advance features.
- Features of TestNG
- Support for Annotations
- Advance execution methodology that does not require test suites to be created
- Support for parameterization
- Support for Data Driven Testing using Data providers
- Setting execution priorities for the test methods
- Supports threat-safe environment when executing multiple threads
- Readily supports integration with various tools and plug-ins like build tools (Ant, Maven, etc.), Integrated Development Environment (Eclipse).
- Facilitates user with an effective means of Report Generation using ReportNG
- Advantages of TestNG over JUnit
- Added advanced and easy annotations
- Execution patterns can be set
- Concurrent execution of test scripts
- Test case dependencies can be set
- TestNG is freely available and can be easily installed in the Eclipse IDE using Eclipse Market.
- Upon installation, TestNG would be available as a library within the Eclipse environment.
- Create a new Java Project and configure the build path using a TestNG library.
- Create a new TestNG class by expanding the created TestNG project and traverse to its “src” folder. Right-click on the “src” package and navigate to New -> Other. Select the TestNG class option.
- @Test is one of the annotations provided by TestNG. This annotation lets the program execution to know that method annotated as @Test is a test method. To use different TestNG annotations, we need to import the package “import org.testng.annotations.*”.
- There is no need of main() method while creating test scripts using TestNG.
- We use the Assert class while comparing the expected and the actual value. The assert class is used to perform various verifications. To use different assertions, we are required to import “import org.testng.Assert”.
- If a test script is composed of more than one test method, the execution priority and sequence can be set using TestNG annotation “@Test” and by setting a value for the “priority” parameter.
- TestNG has the capability of generating human-readable test execution reports automatically. Users can view these reports in any browser, as well as through Eclipse’s built-in browser support.
Next Tutorial #13: Moving ahead with the upcoming tutorials in the Selenium series, we will concentrate on handling the various web elements available on the web pages. Therefore, in the next tutorial, we will concentrate our focus on “dropdowns” and will exercise their handling strategies. We would also discuss WebDriver’s Select class and its methods to select values in the dropdowns.
A remark for the readers: While our next tutorial of the Selenium series is in processing mode, readers can start creating their own basic WebDriver scripts using the TestNG framework.
For more advance scripts and concepts, include as many annotations and assertions in your TestNG classes and execute them using the TestNG environment. Also, analyze the HTML reports generated by TestNG.







I have installed testNG in ecplise kepler but unable to see the testNG in prefaces post installtion. need help
Can u please give one example about Setting Priority in TestNG.
At the time of TestNG run it is showing error msg.
Error: Could not find or load main class org.testng.remote.RemoteTestNG
Can you please provide me a single example to use all TestNG Annotations so that i can understand in a better way.
Good Article …Thanks
@Shipa
Thank You…:)
Not able to execute the code for above. getting below error – kindly suggest the resolution
[RemoteTestNG] detected TestNG version 6.12.0
org.testng.TestNGException:
Cannot instantiate class TestNG.DemoTestNG
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:31)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:420)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:333)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:126)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:191)
at org.testng.TestClass.getInstances(TestClass.java:99)
at org.testng.TestClass.initTestClassesAndInstances(TestClass.java:85)
at org.testng.TestClass.init(TestClass.java:77)
at org.testng.TestClass.(TestClass.java:42)
at org.testng.TestRunner.initMethods(TestRunner.java:455)
at org.testng.TestRunner.init(TestRunner.java:282)
at org.testng.TestRunner.init(TestRunner.java:252)
at org.testng.TestRunner.(TestRunner.java:178)
at org.testng.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:663)
at org.testng.SuiteRunner.init(SuiteRunner.java:230)
at org.testng.SuiteRunner.(SuiteRunner.java:173)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1400)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1380)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1234)
at org.testng.TestNG.runSuites(TestNG.java:1161)
at org.testng.TestNG.run(TestNG.java:1129)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:23)
… 25 more
Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:754)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:41)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:115)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:329)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:207)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:103)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:99)
at TestNG.DemoTestNG.(DemoTestNG.java:13)
… 30 more
Getting same error for me too
same error i face
thanx a lot for wonderfull session.
whenever or always i visit to your site for explaination, and everytime i come her i am left speechless with the kind of material i see.
As i Einstein quoted once “a genius is a person who can explain a very long and complex thing in a single and simple lines”.
Well i would like to compliment the author with the same lines.
Thanks for this article.
Hi,
I am using Nunit i.e.in C3 language.
Will you tell me how to generate results in Nunit.
Do u know any idea about that??
Im getting the result in console & it is passed too. But on refreshing the project testoutput folder is not created.Is there any configuration to be done.Some one please help us here.
Unable to proceed. Getting below error:[RemoteTestNG] detected TestNG version 7.0.1
Exception in thread “main” java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/inject/Stage
at org.testng.internal.Configuration.(Configuration.java:33)
at org.testng.TestNG.init(TestNG.java:216)
at org.testng.TestNG.(TestNG.java:200)
at org.testng.remote.AbstractRemoteTestNG.(AbstractRemoteTestNG.java:17)
at org.testng.remote.support.RemoteTestNG6_12.(RemoteTestNG6_12.java:18)
at org.testng.remote.support.RemoteTestNGFactory6_12.createRemoteTestNG(RemoteTestNGFactory6_12.java:16)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:67)
Caused by: java.lang.NoClassDefFoundError: com/google/inject/Stage
… 7 more
Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 7 more
Hi, were you able to overcome this issue? I am facing the same now,if you have found the solution please let me know
I am getting following message while installing TestNG in my eclipse.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Can anyone suggest ?
thank you so much for this amazing article it helped me a lot to start with TestNG .
Thank you so much!!!
Really helpful…
Please post the instructions to copy paste this code in eclipse as I am not able to run the same. It is giving so many errors
Hi
Shruti mam,
Could you please send me selenium tutorials in single pdf or doc as link is not opening in my company due to some Business restriction .
Regards
Richa
@shweta you need to add testNG class in a package package testNGPackage;
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class FirstTestNG {
WebDriver driver = new ChromeDriver();
@Test
public void f_gmailLogin() {
Love all the information available, very complete and easy to understand.
Would like to volunteer to help improve the writing, there are several grammar errors spread across all pages, for example the beginning of this page (Tutorial 12) states:
TestNG is an advance (should be ‘advanced’) framework designed in a way to leverage the (remove) benefits by (should be ‘for’) both the developers and testers. For people already using JUnit, TestNG would seem no different with some advance (should be ‘advanced’) features.
please include how to do parameterization in TestNG
ITs really a nice and easy walkthrough tutorial.Really appreaciate your work.
Nice Session on TestNG.
I am unable to write code for radio buttons in testNG framework. So kindly any body can suggest the process of operating radio button operation in testNG framework in selenium
Can you let me know the url for which you are writing
It is very useful but can you provide the information about XML file like how to create TestNG XML file and how to integrate multiple TestNG classes in one XML file…..
I am trying to run testNG on Eclipse without sucess.
Here what i get:
org.testng.TestNGException:
Cannot instantiate class onetestngpackage.TestNGFirst
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186)
at org.testng.internal.TestNGClassFinder.(TestNGClassFinder.java:120)
at org.testng.TestRunner.initMethods(TestRunner.java:409)
at org.testng.TestRunner.init(TestRunner.java:235)
at org.testng.TestRunner.init(TestRunner.java:205)
at org.testng.TestRunner.(TestRunner.java:160)
at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:141)
at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:271)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:561)
at org.testng.SuiteRunner.init(SuiteRunner.java:157)
at org.testng.SuiteRunner.(SuiteRunner.java:111)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
… 21 more
Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Function
at onetestngpackage.TestNGFirst.(TestNGFirst.java:12)
… 26 more
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 27 more
Please help to solve this problem
Finally i done with code for TestNG
code i tried is
package TestNg;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.*;
public class tesTingf {
//public String app2 = “https://accounts.google.com/”;
public String app2=”https://accounts.google.com/”;
public WebDriver driver;
@Test
public void gmailLogin() {
//launch the firefox browser and open the application url
System.setProperty(“webdriver.gecko.driver”,”C:\\geckodriver-v0.15.0-win64\\geckodriver.exe”);
driver = new FirefoxDriver();
driver.get(app2);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
// maximize the browser window
driver.manage().window().maximize();
// declare and initialize the variable to store the expected title of the webpage.
String expectedTitle = “Sign in – Google Accounts”;
// fetch the title of the web page and save it into a string variable
String actualTitle = driver.getTitle();
Assert.assertEquals(expectedTitle,actualTitle);
// enter a valid username in the email textbox
WebElement username = driver.findElement(By.id(“Email”));
username.clear();
username.sendKeys(“TestSelenium”);
WebElement next = driver.findElement(By.id(“next”));
next.click();
// enter a valid password in the password textbox
WebElement password = driver.findElement(By.id(“Passwd”));
password.clear();
password.sendKeys(“password123”);
// click on the Sign in button
//WebElement SignInButton = driver.findElement(By.id(“signIn”));
WebElement SignInButton = driver.findElement(By.id(“signIn”));
SignInButton.click();
// close the web browser
driver.close();
}
}
could u pls tell me how to import data from database to facebook login page(username,password)
If emailable-report.html option not available for my project. How solve this problem?.
@Sajid
Your code is also not working..!!!
Hello,
Can i implement keyword driven and data driven framework using testng .
Of course you can implement
TestNG is an extended version to JUnit is wrong .
TestNG is inspired by JUnit. Please correct it in the initial definition.
Sorry, made a mistake.. it is working when refresh the entire project.
Good tutorial to have, helping a lot.
Thanks.
Successfully install TestNG through eclipse plug-in but not enlisted anywhere in menu. Plz help it occured in Eclipse Kepler.
It was a wonderful session….Thnx 🙂
I am trying to use testng as framework for creating testflow for selenium scripts. do we need to create a test method for each action in testng. I am not able to find methods to report “pass” explicitly, We have only log statements but passed log message count is not reflecting in the final report. Final report has only info at test method level and not at step level. please let me know what will be right approach to use testng.
If i have a 3 pages like login, search flights, logout in my application, then do i need to create test methods for actions like
1) Login
2) EnterSearchFlightDetails
3) ClickSearchButton
4) VerifySearchResults
5) Logout
Dear Admin,
Nice topic. Very useful. But am getting error like “com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘ DB name . Table Name’ doesn’t exist.
Kindly assit Please help. ASAP
Simply Superb..!!! Great Work by the author. Much appreciated.
I am trying to run testNG on Eclipse without sucess.
Here what i get:
org.testng.TestNGException:
Cannot instantiate class onetestngpackage.TestNGFirst
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186)
at org.testng.internal.TestNGClassFinder.(TestNGClassFinder.java:120)
at org.testng.TestRunner.initMethods(TestRunner.java:409)
at org.testng.TestRunner.init(TestRunner.java:235)
at org.testng.TestRunner.init(TestRunner.java:205)
at org.testng.TestRunner.(TestRunner.java:160)
at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:141)
at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:271)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:561)
at org.testng.SuiteRunner.init(SuiteRunner.java:157)
at org.testng.SuiteRunner.(SuiteRunner.java:111)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
… 21 more
Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Function
at onetestngpackage.TestNGFirst.(TestNGFirst.java:12)
… 26 more
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 27 more
Please help to solve this problem
pls give any solution to resolve this
Not able to execute the code, getting error
Code –
package firsttestngpackage;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class firsttestngfile
{
public WebDriver driver ;
@Test
public void verifyHomepageTitle()
{
String expectedTitle = “Welcome: Mercury Tours”;
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
}
@BeforeTest
public void launchBrowser()
{
System.setProperty(“webdriver.chrome.driver”, “E:\\selenium\\Selenium-latest-setup\\chromedriver\\chromedriver.exe”);
ChromeOptions options = new ChromeOptions();
WebDriver driver=new ChromeDriver();
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
driver.get(“http://demo.guru99.com/test/newtours/”);
driver.manage().window().maximize();
}
@AfterTest
public void terminateBrowser()
{
driver.quit();
}
}
******************************************
Output after execution
FAILED CONFIGURATION: @AfterTest terminateBrowser
java.lang.NullPointerException
at firsttestngpackage.firsttestngfile.terminateBrowser(firsttestngfile.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:455)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.TestRunner.afterRun(TestRunner.java:725)
at org.testng.TestRunner.run(TestRunner.java:509)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
FAILED: verifyHomepageTitle
java.lang.NullPointerException
at firsttestngpackage.firsttestngfile.verifyHomepageTitle(firsttestngfile.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
You are declaring webdriver driver 2 times. You have already declared driver as public and after that in @BeforeTest you also declaring webdriver driver = new chromedriver(); which is wrong.
So remove webdriver and simply put driver = new Chromedriver() in @BeforeTest method.
Happy Testing…!!!
Thank u very much shruthy , looking for introduction to start selenium,plz add more about scripting
Hi Pratek,
As far as i know TestNG cannot be installed offline. You will need to install it for using the framework. Install via eclipse market place is one option. Please try connecting to an open network so that you can download it.
Shruti,
You have mentioned “Concurrent execution of test scripts” is an advantage of TestNG. Could you please explain with an example.
Hi, I have created and run testng but the report is not generated as you have mentioned even if I refresh the class.
Thank you shruthi, but please add more scripts ,add more information about how to use testNG, update it, then it is more & more helpfull.
Very Good Information!! Thanks a lot for your efforts!
Really it will be helpful for both beginners and experienced professional. Your information is very clear.
Along with your post, I put my input here.
There are number of benefits but from Selenium perspective, major advantages of TestNG are :
It gives the ability to produce HTML Reports of execution
Annotations made testers life easy
Test cases can be Grouped & Prioritized more easily
Parallel testing is possible
Generates Logs
Data Parameterization is possible
Thanks for Explaining selenium basics.
@Krishna
Thank you for your kind words.
Keep Learning….
I getting Error
org.testng.TestNGException:
Cannot instantiate class TestNG.DemoTestNG
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186)
at org.testng.internal.TestNGClassFinder.(TestNGClassFinder.java:120)
at org.testng.TestRunner.initMethods(TestRunner.java:409)
at org.testng.TestRunner.init(TestRunner.java:235)
at org.testng.TestRunner.init(TestRunner.java:205)
at org.testng.TestRunner.(TestRunner.java:160)
at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:141)
at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:271)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:561)
at org.testng.SuiteRunner.init(SuiteRunner.java:157)
at org.testng.SuiteRunner.(SuiteRunner.java:111)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
… 21 more
Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Function
at TestNG.DemoTestNG.(DemoTestNG.java:10)
… 26 more
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 27 more
Thanks guys great tutorial keep up the good work
The sample TestNG code has some error please use the one below I have corrected the missing quotes. Make sure you change the email and password to a valid one before executing
package TestNG;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class DemoTest {
public WebDriver driver = new FirefoxDriver();
String appUrl = “https://accounts.google.com”;
@Test
public void gmailLogin() {
//launch the firefox browser and open the application url
driver.get(“https://accounts.google.com”);
// maximize the browser window
driver.manage().window().maximize();
// declare and initialize the variable to store the expected title of the webpage.
String expectedTitle = “Sign in – Google Accounts”;
// fetch the title of the web page and save it into a string variable
String actualTitle = driver.getTitle();
Assert.assertEquals(expectedTitle,actualTitle);
// enter a valid username in the email textbox
WebElement username = driver.findElement(By.id(“Email”));
username.clear();
username.sendKeys(“TestSelenium”);
// enter a valid password in the password textbox
WebElement password = driver.findElement(By.id(“Passwd”));
password.clear();
password.sendKeys(“password123”);
// click on the Sign in button
WebElement SignInButton = driver.findElement(By.id(“signIn”));
SignInButton.click();
// close the web browser
driver.close();
}
}
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Corrections,I am using C# language.
After i completed all steps but “Plug-in org.testng.eclipse was unable to load class org.testng.eclipse.ui.TestRunnerViewPart.” error trigger in TestNG view
TO EVERYONE GETTING A “Cannot instantiate class” ERROR. Please do the following:
Download the latest geckoDriver.exe from github, place it somewhere safe on your machine
remove the WebDriver code from the beginning of the code and place it inside the method, above the WebDriver instantiation insert System.setProperty(“webdriver.gecko.driver”, “C:\\PATH TO WHERE YOU STORED GECKO\\geckodriver.exe”);
The first few lines of your method should look like this:
public void gmailLogin() {
System.setProperty(“webdriver.gecko.driver”, “C:\\PATH TO WHERE YOU STORED GECKO\\geckodriver.exe”);
WebDriver driver = new FirefoxDriver();
Yes After Do it code will run!
can you please help me regarding below exception
after using maven also i ma getting these exception and i am using latest version of selenium.
>>Selenium web driver exception
Excellent explanation.
Thanks its really been very useful stuff for me.it is a good tutorial
Thanks for making TestNG less daunting and easier for beginners.
Big Thanks!
Thank You Shruti..You have made my Selenium life easy:)
refresh the whole project (not the class).
Is TestNG old? I can not install it on Eclipse 2019 or 2020.
Thanks a lot for sharing this post for beginner…
As usual ! Wonderful Article on TestNG. God bless you !!!
Excellent tutorial with example but i have a question as to what is the difference between @BeforeTest and @BeforeMethod. It looks like both execute the same way.. Could you please explain on this?
Cannot find class in classpath: DemoTestNG
This is the error I am facing please help
@shweta you need to add testNG class in a package package testNGPackage;
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class FirstTestNG {
WebDriver driver = new ChromeDriver();
@Test
public void f_gmailLogin() {
@shweta add package to ur file.
Fantastic…Good Article
Let me know the Best sites for Selenium Frame work learnings
excellent as usual with real examples. very helpful. thanks.
Usage: [options] The XML suite files to run
Options:
-configfailurepolicy
Configuration failure policy (skip or continue)
-d
Output directory
-dataproviderthreadcount
Number of threads to use when running data providers
-excludegroups
Comma-separated list of group names to exclude
-groups
Comma-separated list of group names to be run
-junit
JUnit mode
Default: false
-listener
List of .class files or list of class names implementing ITestListener
or ISuiteListener
-methods
Comma separated of test methods
Default: []
-methodselectors
List of .class files or list of class names implementing IMethodSelector
-mixed
Mixed mode – autodetect the type of current test and run it with
appropriate runner
Default: false
-objectfactory
List of .class files or list of class names implementing
ITestRunnerFactory
-parallel
Parallel mode (methods, tests or classes)
Possible Values: [tests, methods, classes, instances, none, true, false]
-port
The port
-reporter
Extended configuration for custom report listener
-suitename
Default name of test suite, if not specified in suite definition file or
source code
-suitethreadpoolsize
Size of the thread pool to use to run suites
Default: 1
-testclass
The list of test classes
-testjar
A jar file containing the tests
-testname
Hi,this session is help full.can u provide help on testing.xml also.iam in need of that.
hey…..
any one help me how to write code for captcha using testng
hi i just want to know the diff between @before method and @beforetest method of testng i.m bit confused with the above statements
How to install TestNG on eclipse
after refreshing the src folder also , I’m not getting testoutput folder …
also plz tell what you installed in lib folder.
very nice explanation.
here is the example using priority parameter
import org.testng.annotations.Test;
public class testNGPriorityExample {
@Test
public void registerAccount()
{
System.out.println(“First register your account”);
}
@Test(priority=2)
public void sendEmail()
{
System.out.println(“Send email after login”);
}
@Test(priority=1)
public void login()
{
System.out.println(“Login to the account after registration”);
}
}
Hi Mam,
Could you please send me testng tutorials in single file or a link to refer.
Thanks in Advance,
Kishore
I am getting below output, while trying to run my java code using TestNG,
[TestNG] Running:
C:\Users\keshavd\AppData\Local\Temp\testng-eclipse–82361108\testng-customsuite.xml
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\Default suite\Default test.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\Default suite exists: true
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\Default suite\Default test.xml
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\Default suite exists: true
===============================================
Default test
Tests run: 0, Failures: 0, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 0, Failures: 0, Skips: 0
===============================================
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\toc.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\Default test.properties
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\index.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\main.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\groups.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\classes.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\reporter-output.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\methods-not-run.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Problem creating output directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\Default suite\testng.xml.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\Users\keshavd\workspace\Practice\test-output\old\index.html
[Utils] Directory C:\Users\keshavd\workspace\Practice\test-output\old exists: true
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@ec3615b: 28 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@61129920: 3 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@65113ac8: 1 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@7342f820: 2 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@2653a1b3: 30 ms
It is not not working for me.
Please help
Hi have one Question why not set “System.setProperty(“webdriver.chrome.driver”,”/home/Downloads/chromedriver_linux64/chromedriver”);”
and how can code run without it
I am also facing the same issue as keshav does, please help in resolving the same.
Thank u so much…
Good tutorial to start with TestNG
it’s really awesome session
The blog is very useful for me, shares with lots of information and programming language.
Hi,
I am not able to install TestNG plugin from Eclipse’s market place due to some proxy restrictions. Is there any other way to install it by offline mode?
Any help would be appreciated
Thanks
Prateek
Excellent Explanation…..Really it is very helpfull for TestNG beginers…Thank you..
Is it possible to have several classes with multiple NG tests and create a main class that runs all the classes we want? And the results are in a single .html file?
write a sample webdriver program using sort array