-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestNgFramework5.java
More file actions
32 lines (28 loc) · 937 Bytes
/
TestNgFramework5.java
File metadata and controls
32 lines (28 loc) · 937 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
package TestNg;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;
import io.github.bonigarcia.wdm.WebDriverManager;
public class TestNgFramework5 {
@Test
public void title() throws InterruptedException
{
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://jqueryui.com/");
driver.manage().window().maximize();
String atitle = driver.getTitle();
System.out.println(atitle);
String etitle = "jQuery UI";
SoftAssert SAs = new SoftAssert();
SAs.assertEquals(etitle, atitle);
String atext = driver.findElement(By.xpath("//*[@id=\"logo-events\"]/h2/a")).getAttribute("Value");
System.out.println(atext);
String etext = "null";
SAs.assertEquals(etext, atext);
Thread.sleep(5000);
driver.close();
}
}