microsoft / WinAppDriver

Windows Application Driver
MIT License
3.69k stars 1.4k forks source link

Elements disappear from accessibility server after performing a touch click on a disabled element #542

Open kelly987654 opened 5 years ago

kelly987654 commented 5 years ago

Environment Info Application under test: Xamarin Forms v3.4.0.1008975 UWP app WinAppDriver: v1.1.180918001 Device: Tablet running Windows 10 v1803

Steps to reproduce

  1. Start app automation using WinAppDriver
  2. Perform a series of element/touch/clicks on the 'down' button of a custom increment-decrement control until the 'down' button becomes disabled (lowest value reached)
  3. Check the label of a different button using WinAppDriver (button 'A', located just below the increment-decrement control) (everything works)
    • Open Inspect.exe, button 'A' is visible in tree
  4. Perform another element/touch/click on the now disabled 'down' button
  5. Attempt to check the label of the same button again (FAIL => NoSuchElementException)
    • Open Inspect.exe, button 'A' is not visible in the accessibility tree, however it is visible on the screen and can be interacted with as normal.
    • The increment-decrement control seems to have behaved appropriately, by ignoring the tap on the disabled button and not changing any values.

If the above steps are repeated but step 4 is replaced with either a manual tap or a tap by coordinate (using the JWP touch/down, touch/up commands), no issues are observed, and button 'A' remains in the accessibility tree.

hassanuz commented 5 years ago

Hi @kelly987654,

This appears to be an issue either with the Xamarin app platform or some issue within accessibility, as you stated that Inspect is reporting the same behavior.

We'll try repro'ing this on our end and getting the right folks from either Xamarin or Accessibility involved.

kelly987654 commented 5 years ago

Thank you!

khouzam commented 5 years ago

Hi @kelly987654,

I'm unable to reproduce the issue with the standard controls. Can you share the control that's exhibiting this behavior? It might be an issue with the control itself with how it disables items.

Thanks

kelly987654 commented 5 years ago

Thanks for looking into this. I can't share the control unfortunately, but we are going to attempt to create a new sample solution to reproduce the issue.

The strange thing is that its not the control that we're tapping that falls off the accessibility tree, but a different control on the page. Also everything is still visible to the user and can be interacted with, so I don't think its an issue with us setting IsVisible or IsEnabled to false somewhere. Is it possible to set a GUI element to visible to the user but not the accessibility server in Xamarin Forms?

hassanuz commented 5 years ago

Is it possible to set a GUI element to visible to the user but not the accessibility server in Xamarin Forms?

Yes - it is possible to declare your own accessibility attributes, for example if you want to create a GUI element from scratch.