-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestNgAnnotations2.java
52 lines (40 loc) · 1.16 KB
/
TestNgAnnotations2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package TestNg;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import org.testng.Assert;
import org.testng.asserts.SoftAssert;
import io.github.bonigarcia.wdm.WebDriverManager;
public class TestNgAnnotations2 {
WebDriver driver;
@Test (priority=1)
public void Launchbrowser()
{
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
}
@Test (priority=2)
public void verifygoogletitle() throws InterruptedException
{
driver.get("https://www.google.co.in/");
Assert.assertEquals("Google", driver.getTitle());
}
@Test (priority=3)
public void verifyyahootitle() throws InterruptedException
{
driver.get("https://www.yahoo.com/");
Assert.assertEquals("Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos", driver.getTitle());
}
@Test (priority=4)
public void verifyseleniumtitle() throws InterruptedException
{
driver.get("https://www.selenium.dev/");
Assert.assertEquals("Selenium", driver.getTitle());
}
@Test (priority=5)
public void closebrowser()
{
driver.close();
}
}