forked from ajay-cs/selenium_code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimproved_testng.java
More file actions
40 lines (32 loc) · 857 Bytes
/
improved_testng.java
File metadata and controls
40 lines (32 loc) · 857 Bytes
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
package testNG_demo;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class improved_testng {
WebDriver driver;
@BeforeClass
public void launch() {
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
driver = new ChromeDriver();
driver.get("http://www.edureka.co");
}
@Test
public void verifytitle() {
String x = driver.getTitle();
System.out.println(x);
Assert.assertEquals(x,x);
}
@Test
public void verifyurl() {
String x = driver.getCurrentUrl();
System.out.println(x);
Assert.assertEquals(x,"edureka");
}
@AfterClass
public void close() {
driver.close();
}
}