Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScanAsync needs overloads to scan process's UIA sub-trees #1021

Closed
blackcatsonly opened this issue Apr 24, 2024 · 2 comments
Closed

ScanAsync needs overloads to scan process's UIA sub-trees #1021

blackcatsonly opened this issue Apr 24, 2024 · 2 comments
Assignees
Labels
status: active This issue is currently being worked on by someone.

Comments

@blackcatsonly
Copy link
Contributor

blackcatsonly commented Apr 24, 2024

Is your feature request related to a problem? Please describe.

When the UIA tree for the process-under-test is changing frequently, Axe.Windows' ScanAsync produces ScanResults that claim many Rule violations that are not reproducible.

Describe the solution you'd like

Add ScanAsync overloads that accept an IntPtr window handle for more targeted sub-tree scans

Describe alternatives you've considered

Scanning the full process takes too long. In a test or user environment where the UIA surface changes frequently, periodic scanners (like Dave's prototype) produce erroneous violations.
We'd love to have a way to tell the app to pause UI changes while we finish the scan, but no one seems to have a proposal to do that.
So, instead, we're looking to optimize the scan duration and make it less likely that the UIA will change before the pre-scan capture is completed.

Additional context

Sent: Monday, April 22, 2024 1:25 PM
Subject: Re: Help: Axe.Windows scans for volatile UIA

Thanks for the links - we saw the demo, but it doesn't solve our problem. We're using ScanAsync the way you suggest, but it's producing ScanResults that include erroneous claims about violations for missing patterns, null bounding rectangles, etc.

Would you please consider exposing a ScanAsync overload that takes an HWND (IntPtr)? I really want to scan only a very scoped portion of the overall tree, but I only see a way to pass the process ID?

Sent: Monday, April 22, 2024 1:05 PM
Subject: Re: Help: Axe.Windows scans for volatile UIA

Hi,

There is no way for axe-windows to pause another running app. Also, axe-windows does grab all the UIA data before it begins to process its rules, however, grabbing the UIA data is what takes time. These are hundreds or thousands of cross-process calls depending on the size of the UI. And that is a slow process which we have no way to speed up.

ScanAsync method should be used to ensure proper data isolation between scans. You can run scans on a timer , then capture the output and automatically deduplicate the results. You can try similar approach to trigger the scan based on UIA events.

Thanks,

Date: Wednesday, April 17, 2024 at 1:13 PM
Subject: Help: Axe.Windows scans for volatile UIA

Tl;Dr: Do you know how to pause Win32 Desktop app UI changes to avoid bogus Axe.Windows scans? Or tell the Axe.Windows scanner to avoid scanning volatile UI surfaces?

Details:

We are experimenting with ways to expand Accessibility Insights coverage by leveraging the existing Office Automation suite. There are too many features to cover and too many tests to modify manually, so we're attempting to alter the execution environment to passively produce .a11ytest output after the unmodified tests finish.

This is working okay - we trigger Axe.Windows scans from UIA event handlers that get invoked for notable changes in the product app's UI structure. We've found violations in several areas that are hard for vendors to test manually.

However, test actions or other execution context often closes dialogs or alters the UIA hierarchy, so we get outputs that flag a zillion violations for missing patterns, null bounding rectangles, etc.

We have some ideas about injecting pauses in our test actions, but we'd love to have tooling that could ensure the scan completes successfully:

Force the app to block UI changes
OR
Tell Axe.Windows to collect all the data it needs before attempting a scan

@microsoft-github-policy-service microsoft-github-policy-service bot added the status: new This issue is new and requires triage by DRI. label Apr 24, 2024
@JGibson2019 JGibson2019 added status: needs investigation This issue requires investigation (PM, Design, or SWE) by the Accessibility Insights team. and removed status: new This issue is new and requires triage by DRI. labels Apr 30, 2024
@JGibson2019 JGibson2019 added status: active This issue is currently being worked on by someone. and removed status: needs investigation This issue requires investigation (PM, Design, or SWE) by the Accessibility Insights team. labels May 6, 2024
@JGibson2019
Copy link

Thank you @blackcatsonly for working to address this issue; I've updated the status accordingly

codeofdusk pushed a commit that referenced this issue May 13, 2024
…ree (#1022)

Adds:
- ScanOptions property settable to IntPtr for HWND of root of subtree to be scanned
- Teach PID descendants search to operate on HWND's subtree instead of GetRootElement
- Add Integration test for test app leaf node scan

Proposal to address issue #1021
@codeofdusk
Copy link
Contributor

A fix for this issue was recently released in Axe.Windows 2.4.0. Thanks again for your contribution @blackcatsonly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: active This issue is currently being worked on by someone.
Projects
Archived in project
Development

No branches or pull requests

3 participants