In the code below , I am expecting to see the size as 18 but it displays 0. I have not been able to figure out why.
I am going to Amazon searching for books and ultimately want to store the book titles in a array. Thanks !
@Test
public void searchTestOne(){
System.setProperty("webdriver.gecko.driver", "C:\\geckodriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.amazon.in");
driver.manage().window().maximize();
driver.findElement(By.id("twotabsearchtextbox")).sendKeys("Books");
driver.findElement(By.className("nav-input")).click();
List<WebElement> result = driver.findElements(By.xpath(".//*[@id='atfResults']/ul[@id='s-results-list-atf']/li"));
System.out.println(result.size());