-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment195.java
More file actions
32 lines (22 loc) · 779 Bytes
/
Assignment195.java
File metadata and controls
32 lines (22 loc) · 779 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 TestNGCLAssignments;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
//WAP to launch google, type india & find out if the testcase is pass or fail?
public class Assignment195 {
WebDriver driver;
@Test
public void search() {
String excepted = "mobile";
driver = new ChromeDriver();
driver.get("https://www.flipkart.com/");
driver.manage().window().maximize();
WebElement search = driver.findElement(By.name("q"));
search.sendKeys("shoes" + Keys.ENTER);
Assert.assertEquals(driver.getTitle(), excepted, "sorry the title is not matched");
}
}