microsoft / WinAppDriver

Windows Application Driver
MIT License
3.7k stars 1.41k forks source link

How to use Value.Value in XPath #567

Open jonathanw64 opened 5 years ago

jonathanw64 commented 5 years ago

Hi there,

I'm exploring the possibility of converting our automated tests from CUIT to use WinAppDriver and am doing some initial testing with the API to see what's possible. Currently I'm using XPath's to locate elements in our desktop application, with the help of the Inspect tool, however the XPaths fail to compile when I use //*[@Value.Value='01'] as implied by Inspect:

image

This post - #511 - suggests using the UIRecorder tool, however that only returns one possible XPath and in my case it returns a path that will always locate the first row in my table, rather than whichever row contains '01'.

Any suggestions for how to search for Value.Value would be greatly appreciated - I'm hoping I've just got a syntax error but so far I've not found a solution online.

Cheers, Jonny

karniemi commented 5 years ago

To check the "Value", I was able to use Appium method "Element Text Should be" in robotframework-appiumlibrary. "Element Value Should be"-method did not work, it claimed the value to be "None". Though, I'm not sure if this helps you with forming the xpath for selecting a specific row...

hassanuz commented 5 years ago

We've updated the source with regards to the UI Recorder tool that can help with this. Looking to release binaries in the near future, but no ETA as of now.