I am automating a webpage using Selenium Webdriver. I am not able to click a button a modal pop up window using simple element locator method.
Example:
- open www.walmart.com
- enter tv in the search box.
- select some tv and click "Add to Cart"
- Now a pop up window comes where "Checkout" button is located. I need to click on this "checkout" button.
I tried switchTo() windowhandle, I tried switchTo() frame but nothing worked.
This website is very slow and has loading issue. So, I suggest you to use Explicit wait for each findElement. I have written the following script and works perfectly