Monday, December 12, 2022

Selenium - Configure TestNG to your Selenium framework.

To enable TestNG features in out test framework, as the first step we need to load the TestNG libraries to our test development environment(Eclipse).
  • Go to mvnreposotory.com and type in "testng"in the search bar. 
  • In the search results, select the latest available for dependency version. At the time of writing this blog I got below 7.6.1 version. 
  • Copy maven syntax for the dependency, so that we can paste it to our pom.xml. 
  • Once copied append it to the pom.xml of your maven project (which the framework was being built.
  • Accordingly I added below to my pom.xml.
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>7.6.1</version>
    <scope>test</scope>
</dependency>

Also we need to install the testNG plugin to the IDE. Go to Help >> Eclipse Market Place >> search for "TestNG"
Select to install the plugin and you are good.

Featured

Selenium - Page Object Model and Action Methods

  How we change this code to PageObjectModel and action classes. 1 2 3 driver . findElement ( By . id ( "userEmail" )). sendKeys (...

Popular Posts