My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 2760: executeScript and executeAsyncScript should be able to handle alerts.
12 people starred this issue and may be notified of changes. Back to list
Project Member Reported by, Nov 2, 2011
The behavior of executeScript & executeAsyncScript is currently undefined when there is a call to alert/confirm/prompt while a script is executing.  The most basic example would be:

((JavascriptExecutor) driver).executeScript("window.alert('hi!');");

Ideally, we should be able to detect that this has happened and return an error to the user.
Nov 2, 2011
Or perhaps pass in a list of answers, for cases when you're calling JavaScript that you expect to show alerts?

Feb 1, 2012
Project Member #2
This issue was closed by revision r15790.
Status: Fixed
Feb 2, 2012
Project Member #3
See also revision 15810
Feb 3, 2012
Project Member #4
This is only fixed in Firefox. Let's leave this open until it's fixed in the other drivers too.
Status: Accepted
Nov 17, 2012
I am agree we should be able to handle alert, like close it or pass some prompt.
Jun 8, 2014
Project Member #6 barancev
 Issue 7452  has been merged into this issue.
Jul 22, 2014
any changes? is it possible to get the message of the alert or confirm in my java 
    environment with the executeScript? Because alert does still not work with ghostdriver or htmlunit driver.
Sign in to add a comment

Powered by Google Project Hosting