Page 1 of 1

Validation Problem

Posted: Thu Dec 10, 2015 2:47 pm
by Karlsruhe87
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?

Re: Validation Problem

Posted: Thu Dec 10, 2015 3:16 pm
by odklizec
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.

Re: Validation Problem

Posted: Fri Dec 11, 2015 9:54 am
by Karlsruhe87
Here's the snapshot

Re: Validation Problem

Posted: Fri Dec 11, 2015 10:09 am
by odklizec
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
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.

Re: Validation Problem

Posted: Fri Dec 11, 2015 10:45 am
by Karlsruhe87
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?

Re: Validation Problem

Posted: Fri Dec 11, 2015 10:52 am
by odklizec
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.

Re: Validation Problem

Posted: Fri Dec 11, 2015 10:57 am
by Karlsruhe87
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?