Why does Selenium WebDriver not work with my alert?

16,238 views

Published on

I receive this question frequently enough that I should consider it an FAQ.

So "Why does Selenium not work with my Alert?" or "Why can't Selenium handle the alert in my application?"

There is an FAQ answer on the Selenium wiki that shows the Alerts API

http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_Does_WebDriver_support_Javascript_alerts_and_prompts?

But that typically doesn't answer the question because the person asking the question has used the alerts API.

The answer I have given, in every single instance, takes the form "The thing you think is an alert, is not an alert"

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
16,238
On SlideShare
0
From Embeds
0
Number of Embeds
14,068
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Why does Selenium WebDriver not work with my alert?

  1. 1. “Why Does Selenium Not Work With My Alert? Alan Richardson www.SeleniumSimplified.com
  2. 2. Why Can’t Selenium Handle the Alert in my Application?
  3. 3. The Answer: Because it is not an alert
  4. 4. If you can “Inspect Element” on it, then it is not an alert
  5. 5. These Are Alerts: http://www.w3schools.com/js/js_popup.asp http://www.w3schools.com/js/tryit.asp? filename=tryjs_alert http://www.w3schools.com/js/tryit.asp? filename=tryjs_confirm
  6. 6. These are not Alerts http://jquerytools. org/demos/overlay/modal-dialog.html http://tympanus. net/Development/ModalWindowEffects/ http://www.zkoss. org/zkdemo/window/modal_dialog
  7. 7. More Info YouTube Video on this topic ● http://youtu.be/hiN6ugscUco Blog Post ● http://seleniumsimplified.com/?p=666 http://seleniumsimplified.com/2013/10/02/faq-why-does-selenium-not-work-with-this-alert/
  8. 8. Alan Richardson uk.linkedin.com/in/eviltester Independent Test Consultant based in the UK. He offers training and consultancy in Selenium WebDriver, Exploratory and Technical web testing. Contact Alan for training and consultancy tailored to your needs: http://compendiumdev.co.uk/contact Blogs and Websites ● CompendiumDev.co.uk ● SeleniumSimplified.com ● EvilTester.com ● JavaForTesters.com ● Twitter: @eviltester Online Training Courses ● Technical Web Testing 101 ○ Unow.be/at/udemy101 ● Intro to Selenium ○ Unow.be/at/udemystart ● Selenium 2 WebDriver API ○ Unow.be/at/udemyapi Videos youtube.com/user/EviltesterVideos Books Selenium Simplified Unow.be/rc/selsimp Java For Testers leanpub.com/javaForTesters

×