Validate text of list items in .NET framework

Ask general questions here.
van9
Posts: 5
Joined: Mon Apr 25, 2016 12:00 pm

Validate text of list items in .NET framework

Post by van9 » Wed Jun 08, 2016 9:59 am

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validate text of list items in .NET framework

Post by odklizec » Wed Jun 08, 2016 10:06 am

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

van9
Posts: 5
Joined: Mon Apr 25, 2016 12:00 pm

Re: Validate text of list items in .NET framework

Post by van9 » Wed Jun 08, 2016 10:21 am

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.
Attachments
test_snapshot1.rxsnp
Snapshot of the app
(180.21 KiB) Downloaded 28 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validate text of list items in .NET framework

Post by odklizec » Wed Jun 08, 2016 10:27 am

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

van9
Posts: 5
Joined: Mon Apr 25, 2016 12:00 pm

Re: Validate text of list items in .NET framework

Post by van9 » Wed Jun 08, 2016 10:43 am

It really solved my issue.

Thanks a lot.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validate text of list items in .NET framework

Post by odklizec » Wed Jun 08, 2016 12:02 pm

You are welcome. Nice to hear it solved your problem.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration