fix: WebdriverJS with Safari can cause noSuchWindowException#1027
Closed
scottmries wants to merge 1 commit intodevelopfrom
Closed
fix: WebdriverJS with Safari can cause noSuchWindowException#1027scottmries wants to merge 1 commit intodevelopfrom
scottmries wants to merge 1 commit intodevelopfrom
Conversation
15bd58b to
21c454e
Compare
Zidious
requested changes
Mar 22, 2024
Contributor
Zidious
left a comment
There was a problem hiding this comment.
We'd want to scope this fix to webdriverjs so it'd only appear in that package changelog i.e. fix(webdriverjs): ...
Left a comment inline
| await driver.executeScript(`window.open('about:blank')`); | ||
| const handlers = await driver.getAllWindowHandles(); | ||
| await driver.switchTo().window(handlers[handlers.length - 1]); | ||
| await driver.switchTo().newWindow('tab'); |
Contributor
There was a problem hiding this comment.
Sorry Scott - this was my mistake I forgot to amend the issue description. There was some discussion offline about switching to using newWindow. Found that it was only added in Selenium 4 and we do want to continue supporting Selenium 3.
We applied the backwards compatible fix that would work in Selenium 3 and 4 in axe-core-maven-html. For Node it'll be similar
This was referenced Mar 28, 2024
scottmries
added a commit
that referenced
this pull request
Apr 1, 2024
This is the workaround fix that supports Selenium 3 and 4. We would likely switch to #1027 should we drop Selenium 3 support. Rather than always using the last handle after opening a new window, we filter for the unique new handle and use it. This is analogous to the [axe-core-maven-html approach](https://github.com/dequelabs/axe-core-maven-html/blob/ad58b26a8d0e2f1afed33b2c5cbca22b54644b99/selenium/src/main/java/com/deque/html/axecore/extensions/WebDriverExtensions.java#L126). Closes: #936 --------- Co-authored-by: Zidious <Zidious@users.noreply.github.com> Co-authored-by: michael-siek <me@michaelsiek.com>
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproing according to the associated issue would occasionally throw a
noSuchWindowException, about one in three times; this change should fix that.Closes: #936