forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reducing JavaScript errors during findElement(s) for IE
In most cases, executing JavaScript is an atomic action for the IE driver. However, in the off chance that there is a page refresh during the execution of JavaScript, converting the result of the script to a JSON object for serialization might cause an error, in which case we should return the appropriate error to the caller. One place, however, where this might be common is executing findElement(s) across a page navigation. This change makes the driver return the proper error in the post-processing of a script execution. It also recognizes the findElement(s) case, ignoring JavaScript errors in finding elements, and returning the proper structure (an empty list or a "no such element" error) in its place. This lets things like explicit waits retry the find, which may succeed once the page navigation has completed and the DOM available for querying again.
- Loading branch information
Showing
2 changed files
with
78 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters