-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestNgAnnotations3.java
More file actions
60 lines (51 loc) · 1.63 KB
/
TestNgAnnotations3.java
File metadata and controls
60 lines (51 loc) · 1.63 KB
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
53
54
55
56
57
58
59
60
package TestNg;
import static org.testng.Assert.assertEquals;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
public class TestNgAnnotations3 {
WebDriver driver;
@BeforeTest
public void appteststart()
{
System.out.println("Application Testing Started");
}
@Test (priority = 1, description = "This is for launch Webbrowser")
public void Launchbrowser() {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
}
@Test (priority = 2, description = "This is for verify the Googletitle")
public void Verifythegoogletitle()
{
driver.get("https://www.google.co.in/");
Assert.assertEquals("Google", driver.getTitle());
}
@Test (priority = 3, description = "This is for verify the Yahoootitle")
public void Verifytheyahootitle()
{
driver.get("https://www.yahoo.com/");
Assert.assertEquals("Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos", driver.getTitle());
}
@Test (priority = 4, description = "This is for verify the Yahoootitle")
public void verifyseleniumtitle()
{
driver.get("https://www.selenium.dev/");
Assert.assertEquals("Selenium", driver.getTitle());
}
@Test (priority=5, description = "This is for verify the closebrowser")
public void closebrowser()
{
driver.close();
}
@AfterTest
public void apptestfinish()
{
System.out.println("Application Testing Finished");
}
}