How to use TestNG Framework in aiTest


  • Java

How TestNG Framework is going to be used in aiTest

TestNG Framework, supported by aiTest, offers parallel test execution capabilities. This allows you to run tests concurrently, reducing the overall test execution time. By utilizing parallel testing, you can improve the efficiency of your testing process and obtain faster feedback on the quality of your application.

  1. Sign up using your E-mail or Google account.
  2. Once you have reached the URL test dashboard, navigate to the left-side menu and select the Multi-Browser Test.
  3. Hit the Create Testrun button.
  4. Configure your test:
    • Name the testrun: Give the name of testrun whatever you want or which is related to your application, So that it will be easy to get that particular testrun details whenever you want. i.e.,, etc.
    • Project: Select a project in which you want to run your test or you can create a project by clicking on the red colored plus sign(+) button.
    • Testrun Description: Write some testrun description to make your testrun more informative.
    • AUT URL: Application Under Test URL. e.g.
    • Now here you can choose Repo Details or Your Automation Code.
    • Repo Details: Provide the repo details User’s Git Repository URL, User’s Git Username, User’s Git Token or Password, Report File Location and Testrun Command.
    • Your Automation Code: If you select “Your Automation Code” in the previous step, you will need to upload your automation code in a zip file.
    • Testrun Command: Write testrun Command to Run your testrun Testcases mvn test.
    • Report Location: Write Report Location to Stored your testrun Testcases Report Files test-output/testng-results.xml
  5. Select Browsers: At the end select the browser on which you want to run your test. Currently, we have 3 browsers such as, Google Chrome, Mozilla Firefox and Microsoft Edge with their different browser versions.
  6. Once you are done with the above steps you can do either of the following:
    • Run It Now: Immediately run the automation code to test the browser compatibility of your apps with across browsers and versions.
    • Save: Save the configuration for later run as draft testrun.
    • Cancel: Reset and go back to previous page.
    • Update: Update the configurations of the test and run new.
AUT code and can be accessed in aiTest through
  • GIT
  • .zip file

Code Snippets for Reference

Refer the code snippet below:


 package TestPackage;

import java.time.Duration;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.openqa.selenium.JavascriptExecutor;

import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import io.github.bonigarcia.wdm.WebDriverManager;

public class MarxeedTest {
	WebDriver driver;
	ExtentReports extent;
	ExtentTest test;
	public void setUp() {
		extent = new ExtentReports();
		ChromeOptions options=new ChromeOptions();
		driver=new ChromeDriver(options);
	public void test() throws InterruptedException {
		WebElement element = driver.findElement(By.xpath("//p[text()='AI Generated Blogs']"));
		JavascriptExecutor executor = (JavascriptExecutor)driver;
		executor.executeScript("arguments[0].click();", element);
	    String actualTitle=driver.findElement(By.xpath("//h4[text()='AI Generated Blogs']")).getText();
	    Assert.assertEquals("AI Generated Blogs",actualTitle);
	public void trending_blog() throws InterruptedException {
		WebElement element = driver.findElement(By.xpath("//p[text()='My YouTube Channel']"));
		JavascriptExecutor executor = (JavascriptExecutor)driver;
		executor.executeScript("arguments[0].click();", element);
		String actualTitle=driver.findElement(By.xpath("//h4[text()='My Youtube Channel']")).getText();
	    Assert.assertEquals("My Youtube Channel",actualTitle);
	public void quit() {


Questions Answered

  • How TestNG Framework is going to be used in aiTest?


The latest tutorials sent straight to your inbox.