Validation Problem

Ask general questions here.
Karlsruhe87
Posts: 8
Joined: Wed Apr 08, 2015 12:26 pm

Validation Problem

Post by Karlsruhe87 » Thu Dec 10, 2015 2:47 pm

Hello,

i try to validate an certain element within a table. Ranorex can easily spot the element, but I cant read the value in it via validation. The element itsself can be described with this path:

/form[@controlname='HauptFenster']/container[@controlname='mMainDockingArea']/container[@controlname='mDockingArea']//container[@controlname='CoupledListWindow']//container[@controlname='mParentListWindow']/?/?/container[@controlname='mDataList']/table[@controlname='mDataGrid']/row[@accessiblename='Oberste Zeile']/cell[@accessiblename='Obere linke Headerzelle']

The element is also marked in the image. I would like to validate if the text there equals "Anzahl: 1". But with Validation / AttributeEquals and any Matchname which would make sence, the Match is empty:

Attribute 'AccessibleValue' of element for item 'VissimGUIRepository.VissimMainWindow.HauptFenster.ListenRepoItems_Speziell.MainDockingArea.LISTEN.DockingArea.ObereLinkeHeaderzelle' does not match the specified value (actual='', expected='Anzahl: 1').

Where's my mistake or what can I do to validate this element?
Attachments
Unbenannt.png
Unbenannt.png (4.48 KiB) Viewed 563 times

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

Re: Validation Problem

Post by odklizec » Thu Dec 10, 2015 3:16 pm

Hi,

It's hard to say what's wrong without examining snapshot of the element in question. Could you please create and post a Ranorex snapshot of the given element?

If you can't find the string "Anzahl: 1" in any of the available attributes (while examining the element in spy), your only hope is probably GDI Capture List and RawTexts. But as mentioned, it's hard to say without seeing the snapshot.
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

Karlsruhe87
Posts: 8
Joined: Wed Apr 08, 2015 12:26 pm

Re: Validation Problem

Post by Karlsruhe87 » Fri Dec 11, 2015 9:54 am

Here's the snapshot
Last edited by Karlsruhe87 on Fri Dec 11, 2015 10:10 am, edited 1 time in total.

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

Re: Validation Problem

Post by odklizec » Fri Dec 11, 2015 10:09 am

Thanks for the snapshot. As I've expected, there is no AccessibleValue (or any other attribute) containing the value you want to validate. So your only hope is probably using GDI Capture List and RawText. In Spy, right click the mDataGrid element and from the appeared menu select "Add Class Name..." item...
mDataGrid_GDICaptureList.png
mDataGrid_GDICaptureList.png (17.51 KiB) Viewed 544 times
Then refresh the spy and search for RAWText element containing "Anzahl: 1" text. The problem is that you will have to address the particular RAWText element using its index number, which is far from ideal way to address the elements.
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

Karlsruhe87
Posts: 8
Joined: Wed Apr 08, 2015 12:26 pm

Re: Validation Problem

Post by Karlsruhe87 » Fri Dec 11, 2015 10:45 am

At least I know it won't work this way.

Is there a way to readout the text from the element from type Ranorex.Cell and save it as variable?

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

Re: Validation Problem

Post by odklizec » Fri Dec 11, 2015 10:52 am

If you mean reading the value of discussed "Anzahl: 1" cell, then no, there is no way to do this. You see, if you can't find the text in available attributes displayed in Spy (if you track the element), then there is usually no way to read it via code.
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

Karlsruhe87
Posts: 8
Joined: Wed Apr 08, 2015 12:26 pm

Re: Validation Problem

Post by Karlsruhe87 » Fri Dec 11, 2015 10:57 am

Ok then I'll use a different way - validate if a certain line exists or notexists. This method works, the problem: If I validate with notexists, it needs two minutes - is there a way to manually set this value to one minute for this validation?