Showing posts with label Selenium Tutorials. Show all posts
Showing posts with label Selenium Tutorials. Show all posts

REST API testing using Rest Assured

In this REST API testing using Rest Assured post, You will learn what is API and API testing, what is the little difference between SOAP and REST services, and how to test REST APIs using Rest Assured Library.


Rest API Testing using Rest Assured with Examples


What is API?


API full form is Application Programming Interface. It comprises of a set of functions that can be accessed and executed by another software systems. It is an interface between different systems and establishes interaction with systems and data exchange process.

What is API Testing?


In the modern development world, many web applications are designed based on three-tier architecture model. Those are:

1) Presentation Tier – Occupies the top level and displays information related to services available on a website ,User Interface (UI)
2) Application Tier – Also called Middle Tier or Logic Tier ,Business logic is written in this tier which is pulled from Presentation tier. It is also called Business Tier. (API)
3) Data Tier – Here information about database and data is stored and retrieved from a Database. (DB)

REST vs SOAP

REST (Representational State Transfer)


REST is an architectural style that uses simple HTTP calls for inter-machine communication. REST does not contain an additional messaging layer and focuses on design rules for creating stateless services. A client can access the resource using the unique URI and a representation of the resource is returned. With each new resource representation, the client is said to transfer state. While accessing RESTful resources with HTTP protocol, the URL of the resource serves as the resource identifier and GET, PUT, DELETE, POST and HEAD are the standard HTTP operations to be performed on that resource.

SOAP (Simple Object Access Protocol)


SOAP relies heavily on XML, and together with schema, defines a very strongly typed messaging framework. Every operation the service provides is explicitly defined, along with the XML structure of the request and response for that operation. Each input parameter is similarly defined and bound to a type: for example, an integer, a string, or some other complex object. All of this is codified in the WSDL – Web Service Description (or Definition, in later versions) Language. The WSDL is often explained as a contract between the provider and the consumer of the service. SOAP uses different transport protocols, such as HTTP and SMTP. The standard protocol HTTP makes it easier for SOAP model to tunnel across firewalls and proxies without any modifications to the SOAP protocol.

Trending Posts:



REST API Testing Using Rest Assured

What is Rest Assured?

In order to test REST APIs, I found REST Assured library so useful. It is developed by JayWay Company and it is a really powerful catalyzer for automated testing of REST-services. REST-assured provides a lot of nice features, such as DSL-like syntax, XPath-Validation, Specification Reuse, easy file uploads and with those features we will handle automated API testing much easier.

Rest Assured has a gherkin type syntax which is shown in below code. If you are a fan of BDD (Behavior Driven Development).

Rest Assured Example:

public class RestAssured{

@Test
public void appRestTest() {
given()
.contentType(ContentType.JSON)
.pathParam("name", "suresh")
.when()
.get("/restapipath/{name}")
.then()
.statusCode(200)
.body("firstName", equalTo("Suresh"))
.body("Lastname", equalTo("Narayana"));
}
}

Also, we can get JSON response as a string and send it to the JsonPath class and we can use its methods to write flexible structured tests.

public class RestAssured{

@Test
public void appJsonPathTest() {
Response res = get("/RestAPiservice/customer");
assertEquals(200, res.getStatusCode());
String json = res.asString();
JsonPath jp = new JsonPath(json);
assertEquals("rajesh@gmail.com, jp.get("email"));
assertEquals("suresh", jp.get("firstName"));
assertEquals("Narayana", jp.get("LastName"));
}
}


Sikuli Guide For Beginners – Integrate Sikuli With Selenium Webdriver

Sikuli Guide For Beginners – Integrate Sikuli With Selenium Web driver,In this present article, you will learn Sikuli Graphical User Interface Automation Tool in-detail and how to integrate Sikuli tool with Selenium webdriver.

Sikuli Guide for Beginners - Integrate Sikuli with Selenium WebDriver



What is Sikuli Tool:

Sikuli is a Graphical User Interface open source Automation Tool. Using Sikuli Automation tool you could automate whatever we see on the computer screen. It is basically uses image recognition
technology to identify and control GUI elements on desktop. you all know that using Selenium can't automate windows/desktop objects. Integrating Sikuli with Selenium allows us to
overcome this issue. Using Sikuli tool with Selenium webdriver, we could automate windows/desktop objects,Sikuli can automate both Web and Windows based applications.
Most of testers are using Auto-IT tool to upload or download files in Selenium scripting but using Sikuli we can do it very easily.


Advantages of Sikuli Tool:


It is an open source tool for automation.
Easily to integrate sikuli with selenium.
Can automate Desktop / Windows application.
Easily automate Flash objects – Flash Testing.
It can be used on any platform such as Windows/Linux/Mac/Mobile.

Sample program to login to Remote Desktop:


public void normalTest() throws FindFailed {
ImagePath.setBundlePath("D:/Practicle/SikuliProject/src/test/resources/images/");

Screen s = new Screen();
s.type("r",Key.WIN);
System.out.println("Run window is open");
s.type("mstsc");
System.out.println("Run window entered mstsc");
s.click("ok.png");
System.out.println("Click on OK button");
s.wait("remote.png");
System.out.println("Wait for Remote desktop window appers");
s.type("ipaddress");
System.out.println("Remote Desktop entered ipaddress");
s.click("connect.png");
System.out.println("Remote Desktop clicks Connect button");
s.exists("windowsSecurity.png");
s.type("passsword");
System.out.println("Entered password in Windows Security");
s.wait("wok.png");
s.click("wok.png");
System.out.println("OK button is pressed in Windows Security");
s.exists("remoteWind.png");

}

}

How to send extent reports in email with screenshots

How to send extent reports in email with screenshots,While working with Extent Reports,we are able to take the screenshots ,able to attach into Extent html Reports,but while sending those reports in email screenshots not displays.

I've figured how to display screenshots in Extent Reports,if html file location is changed from one folder to another folder with the simple trick as per Extent Reports site directions.

How to send extent reports in email with screenshots





How to Select a Dropdown in Selenium WebDriver using Java

In order to select a dropdown value using Selenium WebDriver we have to create a Select an element and will not use the default WebElements provided by Selenium Webdriver.

Let's consider below drop-down example to select a value using Selenium WebDriver.




1.HTML Dropdown Code:

<select id="citySelect">
<option value="option1">Ahmedabad</option>
<option value="option2">Hyderabad</option>
<option value="option3">Mumbai</option>
<option value="option4">Pune</option>
</select>


1.1 Identify the HTML Element to Select value

Selenium WebDriver providing WebElement class to  identify the or store web element as below

WebElement CitySelection = driver.findElement(By.id("citySelect"));
Select dropdown= new Select(CitySelection);

Another method is directly you can pass in WebElement as below

Select dropdown = new Select(driver.findElement(By.id("citySelect")));


1.2 Select an Option

You can select drodown options by three ways

1.selectByVisibleText(String)
2.selectByIndex(int)
3.selectByValue(String)


2.1 selectByVisibleText:

You can select dropdown value by matching visible text as below

dropdown.selectByVisibleText("Hyderabad")


2.2 selectByIndex:

You can select the dropDown value by index attribute of an element as below

dropdown.selectByIndex(2)

index =1 means Ahmedabad
index=2 means Hyderabad


2.3 selectByValue:

You can select dropDown value by Optioon Value in above HTML code we've used multiple options 1,2,3,4 and code will be

drodown.selectByValue("option2")
dropdown.selectByValue("option1")


3.Complete Selenium Webdriver Code as follows:

WebElement CitySelection = driver.findElement(By.id("citySelect"));
Select dropdown= new Select(CitySelection);
dropdown.selectByIndex(2);
dropdown.selectByValue("option1");
dropdown.selectByVisibleText("Hyderabad");

Selenium WebDriver Page Object Model Framework Introduction

Page Object Model Framework in Selenium WebDriver has come to be very popular Selenium WebDriver test automation framework in the software industry and many IT companies are following this framework because of its easy to write test scripts, Test script maintenance and reduces the duplication of code.

The main merit of Page Object Model in Selenium WebDriver is that if the Web UI changes for any module pages, it don’t require to change any Selenium WebDriver Test Scripts, we just need to change only the Test Page code within the page objects. 


Page Object Model in Selenium WebDriver


Example:


public class LoginPage{

public static WebDriver driver;
private By pageTile = By.xpath("//input[@title='Selenium WebDriver']");
private By homePage=By.id("home");
private By singInPage=By.id("login");
private By uname=By.id("userName");
private By password = By.id("password");

}




In the above code, we've identified the Element locators and defined in the after the class. In this way we can achieve readability of test scripts and we can easily identify Web Element locators and change the Element Locators as per required only in page object classes.
Page Object model in Selenium WebDriver is useful in preparing the AUT functionalities or Reusable components of a Webpage which we want to automate in a separate Test class. Let’s consider as Login Page.

As per Selenium WebDriver ORG Page Object Model is


"Within your web app’s UI there are areas that your tests interact 
with. A Page Object simply models these as
objects within the test code.This reduces the amount of duplicated code
 and means that if the UI changes,the fix need only be applied in one place."

For the above page I’m creating simile class as LoginPage.class. In this class we’ll write reusable methods to call in another class to implement the Test cases.

Let’s consider entry page as Bing Search Page which will have many options like Search, Sign In, Images, Videos, Maps, News Languages, MSN, Outlook.com links. Here as per user action it will navigates to respective web pages to achieve this all functionalities that we want to automate should have reusable methods/components for each web-page.

Now as our main Entry Page is Bing Home page user can navigate to respective pages by clicking on any link from the Bing Search page. Whenever users are navigating to respective pages, we have to return particular page objects. Otherwise Return the current page object as this action doesn't navigate to another page signified by another Page Object.

The Page Object model advantages.

1. Clean Code between test code and page specific code such as locators and layout.
2. Single Object Repository for all functionalities, No Duplication of codes.

In above situation this allows you to perform modifications only in UI because of CR in current requirements or changes in UI Designs.

As per Selenium WebDriver WIKI Page

There is a PageFactory in the support package that provides support for this pattern, and helps to remove some boiler-plate code from your Page Objects at the same time.

Page Object Model in Selenium WebDriver Step by Step Guide

Page Object Model in Selenium WebDriver Projects has become crucial Automation Framework in different organization and many software Testers are implementing Selenium Page Object Model in their project why because it is easy to maintain Test Scripts, easy to understand the Test Execution, easy to maintain Page Object Repository and last but not least reduces the duplication of code.

Recommended Articles

  1. Write Test Cases PASS OR FAIL in Excel with SELENIUM
  2. Create Object Repository in Selenium Project.
  3. Page Factory Framework Implementation Examples.
  4. Start APPIUM server programmatically.


Page Object Model in Selenium WebDriver

The main advantage of Page Object Model in Selenium WebDriver is easy to maintain Page Objects, easy to avoid duplicate of Code. Duplicate code in Selenium cause duplicate of different Functionalities with this duplicate code which results in multiple time repetition of duplicate element locators. You will learn How to implement Page Object Model in Selenium using Simple Examples as explained below. In this examples I’m using simple Login.java class, so that you can implement for other classes in your Selenium Projects.

In this Page Object Model, you need to create two packages

One for Page Objects Second one for Page Test Cases Implementation as below example.

How to IMPLEMENT?

STEP 1: First Create JAVA Project
STEP 2: Configure required JAR files in Build Path
STEP 3: Create two packages under src folder
STEP 4: One Package for Page Object (Object Repository)
STEP 5: Second Package for Page Test Classes.


Login.java

Above class created under page Objects package and code will be as follows
package com.selenium.pageObjects; 
import org.openqa.selenium.*; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.WebElement;
 
public class LoginPage {
 
        private static WebElement element;
 
    public WebElement setUserName(WebDriver driver){
 
         element = driver.findElement(By.id("uName"));
 
         return element;
 
         }
 
     public WebElement setPassword(WebDriver driver){
 
         element = driver.findElement(By.id("password"));
 
         return element;
 
         }
 
     public WebElement clickOnSignin(WebDriver driver){
 
         element = driver.findElement(By.id("submit"));
 
         return element;
 
         }
 
}

WebDriver is being passed as a Method Arguments for each methods, so that Selenium is able to locate the Web Page elements on the specified browser using driver object. In above code element is returned, because method is not a void that is the reason we should return the values inside the method to use in another class or somewhere.so that an Action can be performed on elements. Method is declared as Public WebElement, so that method can be used in any other methods without instantiate the class.Now let’s create Page Test Case class under page Actions package as below for Login Page.

LoginTest.java
package com.selenium.Actions;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.selenium.pageObjects.LoginPage ;

public class LoginTest {

     private static WebDriver driver = null;
 LoginPage login=new LoginPage();

//Main Method
   public static void main(String[] args) {

 System.setProperty("webdriver.gecko.driver","E:\\geckodriver\\geckodriver.exe");
     driver = new FirefoxDriver();
     driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
     driver.get("http://www.yourloginurl.com");

     // Use page Object library now

     login.setUserName(driver).sendKeys("rajesh_3434");
     login.setPassword(driver).sendKeys("makeindia");
     login.clickOnSignin(driver).click();

     System.out.println(" User Login Successfully,My Account screen is open");

      driver.quit();

     }

}





Now create testng.xml file to run your Test Actions classes as specified in your testng.xml file,Just right click on it and Run As – TestNG Tests. 

 You will see Test script Execution on Firefox Browser as provided login credentials. 

 Thank you for reading my blog ,Please share this post in case you feel informative and provide your valuable comments on this post.

Selenium Webdriver Using Python - Complete Tutorial Guide

Selenium supports Python language bindings and can be developed with Selenium Test Scripts for testing.

Python is easy matched to other programming languages, having extreme fewer verbose.
Python language is easy to learn and easy to write the scripts using Python Language.

The Python Language APIs enables you to link with the browser from end to end using Selenium.Selenium guides the standard Python commands to different browsers.

Selenium WebDriver Test Scripts can be run in different browsers and on different operating Systems such as


Firefox
Chrome
IE

What is Python?

Python is a high-level object oriented programming language or scripting Language with dynamic semantics. 


Selenium Webdriver Using Python - Complete Tutorial Guide
Selenium Webdriver Using Python - Complete Tutorial Guide


Selenium WebDriver Using Python - Complete Tutorial Guide

1.Python is a Simple Language
2.Easy to Learn
3.Easy to Read
4.Easy to Maintain


Sample Python Example:


print("Hello World!")
ready = True
if ready:
print("Hello World!")

Why to Choose Python Language in Selenium WebDriver

Below different points explains why Python language is better for Selenium WebDriver scripting, those are

1.Extensive Support Libraries
2.Open Source
3.Learning Ease and better Support
4.User Friendly Data Structure
5.Python uses indentation

Selenium WebDriver Python bindings provides a better API to write functional/acceptance test scripts using Selenium WebDriver. Through Selenium WebDriver Python API we can access all functionalities of Selenium WebDriver in a natural way.

Selenium WebDriver Python Concepts:

Download Python Bindings for Selenium WebDriver
Install Python Language.
Download Drivers for Browsers
First Selenium Python Script
Selenium Web Pages Interaction using Python
Locating Elements
Python Wait Commands
Selenium Page Objects
Selenium WebDriver API

How to Get HTML Source of WebElement in Selenium WebDriver using Python

How to Get HTML Source of WebElement in Selenium WebDriver using Python,While working with Selenium WebDriver scripting using any language bindings whether it is a Python,Java or Ruby,we require to verify Expected Results with Actual results to check Test case is PASS or FAIL.In this selenium WebDriver using python post you will learn Get HTML Source of WebElement in Selenium WebDriver using Python languages.


Get HTML Source of WebElement in Selenium WebDriver using Python


I'm using python bindings to create Selenium Webdriver Test scripts,till now you've learn Selenium Webdriver Test scripting with JAVA but coming to Python language it is completely different.

We can read WebElement source with the help of innerHTML attribute to get the Element Source of the Content.

Using chromeDriver to open Google Chrome Browser.

Different Language code to Get HTML Source of WebElement in Selenium WebDriver,Please use below different code to use in Selenium webdriver Test Scripts.

PYTHON:

element.get_attribute('innerHTML')


PHP:

$elem.getAttribute('innerHTML');


JAVA:

elem.getAttribute("innerHTML");


C#:

element.GetAttribute("innerHTML");


RUBY:

element.attribute("innerHTML")


JS:

element.getAttribute('innerHTML');

Selenium WebDriver Page Factory Model Examples

Page Factory Model is an inbuilt Page Object Model concept for Selenium WebDriver but Page Object Model is much optimized. In this Selenium WebDriver Page Factory Model Examples post you'll learn the concept of separation of Page Object Repository and Test Methods i.e. Test Cases Methods. Moreover, with the help of PageFactory class, we use annotations @FindBy to find Web Element and you can use initElements method to initialize web elements.

@FindBy can accept below attributes to identify the web Elements.
  • ID
  • NAME
  • CLASS NAME
  • PARTIAL LINK TEXT
  • TAGNAME
  • CSS
  • XPATH

We'll discuss above points with brief examples, let's look into below codes to understand How to Implement Selenium WebDriver Page Factory Model in selenium WebDriver Frameworks.
The Page Factory Class help us to write clean Java Code and Reusable Functions in Test Methods. By this Page Factory Model it is easy to code, Easy to understand the code or Test Cases and easy to understand the flow of the Test Cases execution.

Selenium PAGE FACTORY MODEL EXAMPLES

Selenium WebDriver Page Factory Model Examples

Follow below project folder structure to create Page Factory Framework in Selenium Projects. I'm creating three packages under project.
  • Com.selenium.portal.utility
  • Com.selenium.portal.pages
  • Com.selenium.portal.Tests
Step 1: Create JAVA project in Eclipse.
Step 2: Configure Selenium + Require JAR files using Configure Build Path.
Step 3: Add TestNG Library from Configure Build Path screen.
Step 4: Create Above three packages under src folder.

Now let's see each Packages Class Files, Create WebdriverInstance.java class under Com.selenium.portal.utility package, from this class we're using driver instance and Writing results to log using @AfterMethod method and taking screenshot for failed tests.

WebdriverInstance.java

package com.selenium.portal.utility;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.Alert;
import org.openqa.selenium.Keys;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeMethod;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.Status;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.aventstack.extentreports.reporter.configuration.ChartLocation;

public class WebdriverInstance {

public static WebDriver driver;
public static ExtentReports extent;
public static Properties property;
public static ExtentHtmlReporter htmlReports;
public static ExtentTest test;
String fileName = System.getProperty("user.dir")+"/test-output/TestResults.html";

public void openBrowser() throws IOException {

property = new Properties();
FileInputStream orFile = new FileInputStream("E:\\Eclipse_Oxygen\\selenium\\OR.properties");
property.load(orFile);  

System.setProperty("webdriver.gecko.driver",property.getProperty("geckodriver"));
driver = new FirefoxDriver();

//ExtentReports details
htmlReports= new ExtentHtmlReporter(fileName);
extent = new ExtentReports();
extent.attachReporter(htmlReports);
htmlReports.config().setReportName("HYPERCITY REGRESSION TESTING");
htmlReports.config().setTestViewChartLocation(ChartLocation.TOP);


//Using extent set system information
extent.setSystemInfo("OS", "Windows 7");
extent.setSystemInfo("Browser", "Firefox 56V");
extent.setSystemInfo("Environment","QA");
extent.setSystemInfo("Server", "10.0.7.179");

}

//A Method provides information about, and access to, a single method on a class or interface
@BeforeMethod
public void afterMethod(Method results){
test=extent.createTest(results.getName());
test.log(Status.INFO, results.getName() + " Test is started");

}

@AfterTest
public void afterTest() {
extent.flush();
}

public String validatePageTitle() {  

return  driver.getTitle();
}


@AfterMethod
public void verifyTestResults(ITestResult results) {

if(results.getStatus()==ITestResult.FAILURE) {
test.log(Status.FAIL, results.getName() + " Test case is Failed because of below reason");
test.log(Status.FAIL, results.getThrowable());

}else if(results.getStatus()==ITestResult.SKIP) {
test.log(Status.SKIP, results.getName() + " Test Case execution is skipped because");
test.log(Status.SKIP, results.getThrowable());

}else {
test.pass(results.getName() + " Test Case is PASS");

}

}

public void takeScreenShot() throws IOException {

File screenShot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
File screenShotName = new File(System.getProperty("user.dir")+"/Screenshots/"+driver.getTitle()+"_"+".png");
FileUtils.copyFile(screenShot, screenShotName);

}
}

Now Create pages under com.selenium.portal.pages package, which will store all the web elements attributes means it'll work as Object Repository class, Like Below.

LoginPage.java

package com.selenium.portal.pages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import com.selenium.portal.utility.WebdriverInstance;

public class Login extends WebdriverInstance {  
 
 //Using PageFactory model
 @FindBy(id="userNameId")
 static WebElement userName;
 
 @FindBy(id="passwordId")
 static WebElement password;
 
 @FindBy(id="submitID")
 static WebElement loginSubmit; 
 
 public Login() {
  PageFactory.initElements(driver, this);
 }
 
 public String validateLoginTitle() {   
  return  driver.getTitle();
 }
 
 public  void setUserName(String uName) {
  userName.sendKeys(uName);
  
 }
 public void setPassword(String passsword) {
  password.sendKeys(passsword);
 }
 
 public void clickOnLogin() {
  loginSubmit.submit();
 }

}


Now we need to write @Test under Com.selenium.portal.Tests package, Create a class and Name as LoginTest.Java, here we're writing all possible test cases based on Login.java class object repository class as below.

LoginTest.java

package com.selenium.portal.Tests;
import java.io.IOException;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.aventstack.extentreports.Status;
import com.selenium.portal.pages.Login;
import com.selenium.portal.utility.WebdriverInstance;

public class LoginTest extends WebdriverInstance {
 
Login login;

@BeforeClass
public void setUp() throws IOException {
 openBrowser();
 takeScreenShot();
 login = new Login();
 
}

@Test(priority=1)
public void openAUTUrl() throws IOException {
 System.out.println("First Test");
 driver.get(property.getProperty("baseUrl"));
 takeScreenShot();
 
}

@Test(priority=2)
public void verifyPageTitleTest() {
 System.out.println("Second Test");
 test.log(Status.INFO, "Verifying the Page Title");
 String title = login.validateLoginTitle();
 Assert.assertEquals(title, property.getProperty("loginPage"));
 test.log(Status.PASS, "Login page title is matching with Expected Title");
 
}

@Test(priority=3)
public void loginTest() throws InterruptedException, IOException {
 System.out.println("Third Test");
 
 test.log(Status.INFO, "Entering Username and Password");
 System.out.println(property.getProperty("userName"));
 System.out.println(property.getProperty("passWord"));
 
 login.setUserName(property.getProperty("userName"));
 login.setPassword(property.getProperty("passWord"));
 Thread.sleep(5500);
 takeScreenShot();
 login.clickOnLogin();
 
}

@Test(priority=4)
public void userAccountTest() throws IOException {
 System.out.println("Fourth Test");
 
 test.log(Status.INFO, "Verify User Account screen is open");
 try {
  Thread.sleep(5500);
 } catch (InterruptedException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }
 
 String accountTitle = login.validatePageTitle();
 System.out.println(accountTitle);
 Assert.assertEquals(accountTitle, property.get("selectProgramTitle"));
 takeScreenShot();
 test.log(Status.PASS, "Select Program title is matching with Expected Title");
}

}

We'll run the Tests with the help of testng.xml file and testng.xml file is

Now Right click and run your testng.xml file and it'll start executing your all @Test method one by one.


Thank you for reading, if you like my post, please share with your friends and provide your valuable comments and don't forget to implement this model in your project.