Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SeleniumIDE Issue - js alert() is not detected by IDE

These steps will reproduce the problem:

  1. Open
  2. Click on the "try it" button
  3. The clicking of OK on alert is not captured by IDE
share|improve this question
Hi user1579906. A comment was left in the other question where you asked this explaining that this would happen with Selenium IDE and Javascript Alerts. Is this different? – Lyndon Vrooman Aug 13 '13 at 14:24
Wanted a workaround or solution to this issue – user1579906 Aug 13 '13 at 15:35

SeleniumIDE handles JavaScript alerts by not showing them at all. The problem is that this button and alert is generated in an iFrame, thus the resulting error message is also in the iFrame and cannot be handled unless it has focus.

Selenium handles iFrame as a sort of window, you first need to select it to interact with it.

Try these steps to verify it does indeed work:


Result is an message in the IDE console, instead of an JavaScript alertbox: [error] Error: There was an unexpected Alert! [Hello How are you?]

Also read this about handling javascript alerts with the Selenium IDE:

share|improve this answer

Look at the given link for example-

  1. How To Handle JavaScript Prompt Box:

  2. How To Handle JavaScript Confirm Box:

  3. How To Handle JavaScript Alert Box:

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Varun, the link may answer the question, but it's preferred that answers stand on their own instead of needing the link to be followed. Links should support already good answers, not be the entire answer. Also, if you're linking to something you yourself wrote you should include that in your answer. (Including the other answer that is letter for letter identical to this one...) – corsiKa Nov 10 '14 at 20:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.