-1

enter image description here

http://automationpractice.com/index.php?id_category=9&controller=category

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.

  1. open http://automationpractice.com
  2. click "Add to Cart".
  3. Now a pop up window comes where "Checkout" button is located. I need to click on this "Proceed to checkout" button.

I tried switchTo() windowhandle but nothing worked.

halfer
  • 19,824
  • 17
  • 99
  • 186
siva k
  • 1
  • 1
  • Please edit and rewrite your question properly. Include code also. – Vikas Yadav Feb 17 '18 at 08:30
  • Possible duplicate of [Not able to locate element on a modal pop up window in Selenium](https://stackoverflow.com/questions/32685447/not-able-to-locate-element-on-a-modal-pop-up-window-in-selenium) – halfer Mar 19 '18 at 12:36
  • This is an obvious copy+paste [of this question](https://stackoverflow.com/questions/32685447/not-able-to-locate-element-on-a-modal-pop-up-window-selenium), including most of the phrasing and even a copypasta tripwire. I can't understand why a question would be duplicated here so deliberately - please write in your own words instead. – halfer Mar 19 '18 at 12:37

1 Answers1

0

It is a normal will work without any alert code. Just directly identify the element. Just use explicit wait with this.

Shobhit
  • 1
  • 2