How to use TestNG Framework in aiTest

Language

  • 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 Test 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. test-example.com, test-demo.com, 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. https://example.com
    • 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 clean test.
    • Report Location: Write Report Location to Stored your testrun Testcases Report Files target/surefire-reports/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:

Java

  
 package tests;

import java.io.IOException;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import hooks.TestNgHooks;
import pages.HomePage;
import pages.LoginPage;

public class TC001_CreateLead extends TestNgHooks{
	
	@BeforeTest
	public void setData() {
		testCaseName = "TC001Login";
		testDescription = "Login to Leaftaps";
		category = "smoke";
		authors = "Babu";
		dataSheetName = "TC001";
		nodes = "Leads";
	}

	@Test(dataProvider="fetchData")
	public void createLead(String companyName, String firstName, String lastName) {
		new HomePage()
		.clickCRMSFA()
		.clickLeadsTab()
		.clickCreateLeadLink()
		.typeCompanyName(companyName)
		.typeFirstName(firstName)
		.typeLastName(lastName)
		.clickCreateLead()
		.verifyTitle();
	}
	
}

 

Questions Answered

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

Subscribe

The latest tutorials sent straight to your inbox.