Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

executeScript and executeAsyncScript should be able to handle alerts. #2760

Open
lukeis opened this issue Mar 3, 2016 · 8 comments
Open

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 2760

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.

Reported by jmleyba on 2011-11-02 18:08:13

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Or perhaps pass in a list of answers, for cases when you're calling JavaScript that
you expect to show alerts?

Reported by skybrian@google.com on 2011-11-02 18:40:44

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This issue was closed by revision r15790.

Reported by dawagner on 2012-02-01 18:48:38

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

See also revision 15810

Reported by dawagner on 2012-02-02 18:24:08

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This is only fixed in Firefox. Let's leave this open until it's fixed in the other drivers
too.

Reported by jmleyba on 2012-02-03 23:36:17

  • Status changed: Accepted

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I am agree we should be able to handle alert, like close it or pass some prompt.

Reported by ni184775761 on 2012-11-17 16:40:40

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Issue 7452 has been merged into this issue.

Reported by barancev on 2014-06-08 18:42:37

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

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.

Reported by juzwa@gmx.net on 2014-07-22 17:21:33

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 17:44:25

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant