Skip to content

Bug: NoSuchWindowException being thrown when trying to run AxeBuilder.cs .Analyze() method on Safari browser on Mac OS #177

Open
@RhiannonJonesAC

Description

@RhiannonJonesAC

I am trying to run .Analyze() on the Safari browser but I am getting a NoSuchWindowException. There seems to be a blank browser tab opened (which I have read from the similar issue: dequelabs/axe-core-maven-html#391 is intentional) but when trying to switch back to the browser tab with the intended website page in, it no longer exists.

I have also ran the same test against the Chrome and Firefox browser on Mac (and Edge, Chrome, Firefox on Windows), and there are no issues.

I have tried running the test with the use of the obsolete method .UseLegacyMode() and the test does work. But obviously this is an obsolete method so I would prefer to not use this.

Message: 
Test method Tests_ACWEB.Tests.Accessibility.AccessibilityTests.AccessibilityAnonymousProductCategory threw exception:
OpenQA.Selenium.NoSuchWindowException:

Stack Trace: 
WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
TargetLocator.Window(String windowHandleOrName)
TargetLocator.Window(String windowHandleOrName)
AxeBuilder.IsolatedFinishRun(Object[] partialResults, Object options)
AxeBuilder.AnalyzeAxeRunPartial(Object rawContextArg)
AxeBuilder.AnalyzeRawContext(Object rawContextArg)
AxeBuilder.Analyze()

Expected behavior
Accessibility analysis to be ran against our website page that is navigated to before the blank page is opened

Actual behavior
A blank page is opened and the website page first changes to also be a blank page and then is closed, resulting in a) no analysis and b) a NoSuchWindowException being thrown

Screenshots

  1. Website page navigated to where accessibility analysis is required:
    website

  2. A blank page browser tab starts to open:
    blank tab opened

  3. The blank page tab is fully loaded but at the same time the original tab is now also a blank page!:
    both tabs are blank

  4. Finally only a blank page browser tab / window is left open:
    only blank tab

Related Tickets
This ticket is related but is for Java (dequelabs/axe-core-maven-html#391)

Desktop (please complete the following information):

  • Product: Selenium with C# in the test repo and Deque.AzeCore.Selenium v4.9.1
  • Product Version: 4.9.1
  • Latest Product Version it is NOT happening in: if the .UseLegacyCode() is used
  • OS: MacOS
  • Browser : safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingweb-apis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions