-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment197.java
More file actions
38 lines (24 loc) · 1.03 KB
/
Assignment197.java
File metadata and controls
38 lines (24 loc) · 1.03 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
package TestNGCLAssignments;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
//WAP to launch amazon, search shoes & find out if the testcase is pass or fail?
public class Assignment197 {
WebDriver driver;
@Test
public void amzon01() throws InterruptedException {
String Excp = "Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in";
driver = new FirefoxDriver();
driver.get("https://amazon.in");
driver.manage().window().maximize();
WebElement search = driver.findElement(By.id("twotabsearchtextbox"));
search.sendKeys("mobiles" + Keys.ENTER);
List<WebElement> s1 = driver.findElements(By.xpath("//div[@='a-section aok-relative s-image-fixed-height']"));
Assert.assertEquals(s1.size(), 15, "total count doesnt matched"); // testcased failed
}
}