Page 1 of 1

Validate text of list items in .NET framework

Posted: Wed Jun 08, 2016 9:59 am
by van9
Hi,

My application has a list box whose contents are populated dynamically. So when I try to record and validate the list item elements, I am not able to validate a single particular element. Please let me know how to do it.

Re: Validate text of list items in .NET framework

Posted: Wed Jun 08, 2016 10:06 am
by odklizec
Hi,

Could you please upload a Ranorex snapshot (not screenshot!) of the problematic listbox? Additionally, please post an example of xpath you are using for validation.

BTW, is the number of items (and their names) always the same, just loaded at different positions? In other words, what exactly you want to validate? Particular item(s) or entire list of items?

Re: Validate text of list items in .NET framework

Posted: Wed Jun 08, 2016 10:21 am
by van9
Hi,

I could get the path only upto the listbox. (/form[@wpfnative='True' and @title='MainWindow' and @processname='Dataloader.View']/?/?/element/container/container/container[1]/list)

But I am not able to validate the elements inside the listbox.

I would like to validate the text of an element in the list box.

Re: Validate text of list items in .NET framework

Posted: Wed Jun 08, 2016 10:27 am
by odklizec
Go to Global Settings >> Plugins tab and here try to enable "Realize Items in Virtualizing Containers" option (under WPF section). Eventually, try to enable "Show All Elements" option. Then refresh Spy and check the list again. Hope this helps?

Re: Validate text of list items in .NET framework

Posted: Wed Jun 08, 2016 10:43 am
by van9
It really solved my issue.

Thanks a lot.

Re: Validate text of list items in .NET framework

Posted: Wed Jun 08, 2016 12:02 pm
by odklizec
You are welcome. Nice to hear it solved your problem.