Help with ecommerce website and pop which says ‘Go to Checkout’ or ‘Continue Shopping’
I am new to all this. On the eCommerce website where I am assuming a pop up box appears which says ‘Go to Checkout’ or ‘Continue Shopping’ I cant get my tests to get pass this.
Are there answers for the eCommerce website somewhere?
Any help appreciated.
Couldn’t get it working through the CSS. What i did was add a small sleep as you will see from the snippet below and it appears to have done the trick. Some sort of sync issue perhaps. Got lots to learn at the moment. Really appreciate the help so far.
driver.find_element(:link_text, “All Product”).click
driver.find_element(:link_text, “iPhone 5″).click
driver.find_element(:xpath,”//input[@value=’Add To Cart’]”).click
driver.find_element(:link_text, “Go to Checkout”).click
#’expect(driver.find_element(:tag_name, “body”).text).to include(“Checkout”)
Apologies. Please find some more info. When i inspect the element this is the code it points me to. I also attach what I have in my code below where essentially when trying to click on the go to checkout button it is failing. Base URL is http://store.demoqa.com/. Any help greatly appreciated.
<div class=”popup” style=”display: block;”></div>
<div id=”fancy_notification” class=”group” style=”display: block; position: fixed; left: 50%; top: 50%; margin-left: -185px; margin-top: -75px;”>
<div id=”fancy_notification_content” class=”group” style=”display: block;”>
<span>You just added “iPhone 5″ to your cart.</span>
<a class=”go_to_checkout” href=”http://store.demoqa.com/products-page/checkout/”>Go to Checkout</a>
<a class=”continue_shopping” onclick=”jQuery(“#fancy_notification”).css(“display”, “none”); return false;” href=”#”>Continue Shopping</a>
Yes I remember that we also faced similar issue. That’s a great find, please mark your question as answered and mark your answer above as the right answer.
Instead of thread.sleep you would like to put and explicit wait,
Thanks and keep posting.