microsoft / WinAppDriver

Windows Application Driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extracting data from ListBox item

mooragor opened this issue · comments

I'm testing an old application which has a ListBox. In the app itself I can see the list of names in the ListBox, however when using Inspect.exe, I can't find the displayed text anywhere.

I've been able to get hold of all of the ListBox items using WinApDriver, but again, can't find the 'text' within the item object to be able to pick the right one to click.

I'm guessing that if Inspect can't see that text that it's also not accessible to WinApDriver.
Is there anything I can do to make that text visible? Do I need to modify the data object that is being listed to have accessor methods or something (data object below)

image

image

image

image

Sometimes this text is displayed from value field, sometimes from Name and sometimes from other attribute. Not always it will be accessible for winappdriver.

Any details on why data may not be available to WinAppDriver, or what can be changed in the code of the application to make it available?

Like I mentioned in comment above. Try to find element with a locator that hold list item and try to inspect LegacyName and LegacyValue attributes for this and child elements. Not always must be nested text element. If none of the elements that can be located hold any sign of that text there is possibility it is just a winappdriver limitation.

@mooragor I believe the first document after the list item has it.
AppiumWebElement document;
document.GetAttribute("Value.Value");

Sometimes you get lucky and you can simply do:
ListItem.Text;

Yay!!!! Thank you so, so much @liljohnak. That got me the data!

Moo.