-
Notifications
You must be signed in to change notification settings - Fork 969
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
System.Windows.Automation.InvokePattern.Invoke blocks on a menu item. #10244
Comments
@Olina-Zhang can your team please test this to confirm? |
@elachlan we can repro this issue on .NET 6.0, 7.0, 8.0 and 9.0. |
[like] Chris Lovett reacted to your message:
|
I and @Amy-Li03 discussed this issue, and we think this is not a a11y issue. |
@Epica3055 let's discuss in the next meeting. |
@Amy-Li03 - Could you please verify if this issue reproduces on 4.7.2 and 4.8.1 and if it depends on any AccessibilityImprovements.Level? |
Attached is a .NET Framework 4.7.2 version of the above test app and the test passes (the invoke does not block) If you then change the project properties to target .NET Framework 4.8, the test fails as per my original bug report. |
@Tanya-Solyanik , this issue reproduces on .NET Framework 4.8 & 4.8.1 and it doesn't repro on 4.7.2 and its previous versions.
|
.netFramwork4.7 project:
netFramwork4.8.1 project:
|
@LeafShi1 - does 4.8.1 sample block as well? |
Yes |
@LeafShi1 - what other controls does this reproduce for? |
So this problem only reproduces in MenuStrip, and the invoke event of menuItem needs to pop up a new windows page. |
@LeafShi1 - do we have any unit tests that call the Invoke method on controls? If not, could you please add some? |
Many controls contain an IsPatternSupported test but the Invoke method on the control is not tested? Do we need to complete all of them? Such as Lines 128 to 135 in 9313f05
|
Start with the MenuItems mentioned in this bug and buttons, we'll see if we need to add more later. |
Try to add following test, the System.Windows.Forms.AccessibleObject.Invoke blocks on Button and MenuItem. But
|
This is interesting, my test application was blocking on a button. I was doing a cross process access though. I have a driver application and a test application, and the driver is invoking buttons in the test app. Let's test only for menuitems for now. Going forward we can start replacing code that send clicks to buttons(or other controls) with AccessibleObject.Invoke in tests that excersize control functionality. |
Well after waiting for almost a year I've given up waiting. I ended up implementing my own custom automation layer for my menu items so that I could invoke them asynchronously. This gets my unit tests back up and running finally. |
.NET version
7.0.403
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Don't know, it works in .NET Framework 4.6.2, but not in latest version of .NET Framework 4.8
Issue description
Run the unit test in the following solution. Notice that the unit test hangs on line 80 of UnitTest1.cs which is the InvokePattern.Invoke call on the FIle/Open... menu item. This makes it impossible to test any menu item using System.Automation?
Steps to reproduce
WinFormsApp1.zip
The text was updated successfully, but these errors were encountered: