MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Inconsistent reporting of UI Automation elements
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
The WebView2 control is inconsistent in what UIA elements it reports. The first time its UIA elements are enumerated, only a partial set is returned. On subsequent enumerations, the full set is consistently returned. This occurs in Edge, in the WebView2 samples, and with a tiny test app that we created separately. This behavior does not occur in Chrome, so it seems unlikely that this is a Chromium bug.
Version
SDK: Unknown
Runtime: 113.0.1774.57 (as reported by Control Panel)
Framework: WinForms (also happens with WPF)
OS: Win11 22H2
Repro Steps
- Install the Axe.Windows CLI from https://github.com/microsoft/axe-windows/releases/tag/v2.1.2
- Build the WebView2WindowsFormsBrowser test app from https://github.com/MicrosoftEdge/WebView2Samples
- Run WebView2WindowsFormsBrowser.exe
- Open task manager to get the main process. This will be listed as WebView2WindowsFormsBrowser in the UI--in this screenshot, the processID we want is 9196
- Run the Axe.Windows CLI tool and note how many errors are reported
- Run the Axe.Windows CLI tool again and note that the error count has changed
- You can run the Axe.Windows CLI tool additional times and note that the error count remains constant
- The error count should remain constant, but the first call doesn't enumerate the entire tree. This is demonstrable by opening the generated
.a11ytestfiles in Accessibility Insight for Windows and comparing the reported hierarchies. As demonstrated below, the contents of the Document control are completely absent from the first test.
Screenshots
| Iteration | Command line (exe is on path) | Errors reported |
|---|---|---|
| 1 | AxeWindowsCLI.exe --outputdirectory %userprofile%\desktop --scanid 1 --processid 9196 |
23 |
| 2 | AxeWindowsCLI.exe --outputdirectory %userprofile%\desktop --scanid 2 --processid 9196 |
195 |
| 3 | AxeWindowsCLI.exe --outputdirectory %userprofile%\desktop --scanid 3 --processid 9196 |
195 |
Comparisons of 1st iteration and 2nd iteration in Accessibility Insights for Windows. The selected element is identical in each, but the first set of results omit the Document control containing the HTML.
| Call # | Returned UIA hierarchy |
|---|---|
| 1 | |
| 2 |
Additional context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.