Video Tutorial link https://youtu.be/oQ4-HjhCbis
package testNGExamples;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
public class BingTest {
WebDriver driver;
@Test
public void bingTitleVerification() {
driver.get("http://bing.com");
Assert.assertEquals(driver.getTitle(), "Bing India");
}
@Test(dependsOnMethods="bingTitleVerification")
public void searchVerification() {
driver.findElement(By.name("q")).sendKeys("magnetic automation");
driver.findElement(By.name("q")).sendKeys(Keys.ENTER);
Assert.assertEquals(driver.getTitle(), "magnetic automation - Bing");
}
@BeforeTest
public void beforeTest() {
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\mprem\\OneDrive\\Desktop\\SelJars\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
}
@AfterTest
public void afterTest() {
driver.quit();
}
}
Fantastic to read this blog. Thanks you so much for sharing this kind of article.
ReplyDeletePython Classes in Chennai
Python Classes Near Me
Best Python Training in Bangalore
This post is so interactive and informative.keep updating more information...
ReplyDeleteETL tools
Python
valuable blog,Informative content...thanks for sharing, Waiting for the next update…
ReplyDeleteWhat is google flutter?
Benefits of Flutter