I am trying to automate one case on the following page:
http://automationpractice.com/index.php?id_product=4&controller=product
With step:
Load Page > Click 'Add to cart' > Popup appears with buttons > Press 'Proceed to checkout'
However, my code is failing on Click "elementButton.click()"
The Exception I get:
"Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible "
The element is enabled; however, it is invisible either because it's a popup and I have to move to popup window and then click check out, or Alert/Pop seems to not working.
If anyone please could assist. Many thanks in advance.
driver.get("http://automationpractice.com/index.php?id_product=4&controller=product");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS);
driver.findElement(By.xpath(".//*[text()='Add to cart']")).click();
WebElement elementButton = driver.findElement(By.xpath(".//a[contains(@title,'Proceed to checkout')]"));
System.out.println(" ****elementButton**********" + elementButton.isEnabled()); // returning true
elementButton.click();