HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Assert Method - TestNG Tutorial 6

1,600 views November 13, 2018 9:39

Watch on YouTube
ChannelAutomation Zone

Description from the creator

This tutorial will explain how use the Assert Method in TestNG

Sample Code :

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.Test;

public class Tutorial6 {

@Test()
public void TC_1() {
System.setProperty("webdriver.chrome.driver", "D:\\YouTube\\TestNG\\Libs\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("google.com";);
String title = driver.getTitle();
System.out.println(title);
Assert.assertEquals(title, "Google" , "Asserting the Title");
boolean bol_searchbox = driver.findElement(By.name("q")).isDisplayed();
Assert.assertTrue(bol_searchbox , "Checking if the seachbox is displayed");
driver.close();
}
}

About this tutorial

Automation Zone published this 9:39 video tutorial on November 13, 2018. It has been watched 1,600 times on YouTube.

Category
Education
Duration
9:39
Published
November 13, 2018
Views
1,600
Likes
22

Tags

Share

This tutorial in other languages