-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestNgFramework4.java
More file actions
28 lines (25 loc) · 846 Bytes
/
TestNgFramework4.java
File metadata and controls
28 lines (25 loc) · 846 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
package TestNg;
import org.openqa.selenium.By;
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;
public class TestNgFramework4 {
@Test
public void title()
{
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://www.ebay.com/");
driver.manage().window().maximize();
String atitle = driver.getTitle();
System.out.println(atitle);
String etitle = "Electronics, Cars, Fashion, Collectibles & More | eBay";
Assert.assertEquals(etitle, atitle);
String atext = driver.findElement(By.xpath("//*[@id=\"gh-btn\"]")).getAttribute("Value");
System.out.println(atext);
String etext = "Search";
Assert.assertEquals(etext, atext);
}
}