Page 1 of 1

How to access Advanced Properties of object

Posted: Thu Oct 30, 2014 2:57 pm
by marasanov
Hi all,

Is it possible to check a value in advanced properties of object in Element Browser? For example, I need to check the 'Text' value from the following object property (look at the attachment for details).

Thanks.

Re: How to access Advanced Properties of object

Posted: Tue Nov 04, 2014 2:13 pm
by Support Team
Hello marasanov,

Just add the tracked element to your repository. Drag it to the action table and choose “Validation”:
DragToActionTable.png
Validation.png
Finally, choose the desired attribute (MatchName) and set the expected value (MatchValue):
ChooseAttributeEqualMatchName.png
Regards,
Robert

Re: How to access Advanced Properties of object

Posted: Wed Nov 05, 2014 11:37 am
by marasanov
Hi Robert,

Unfortunately, this doesn't work for me. When I add validation step, I can't choose the properties that I need. These are the options that it offers me:
properties.jpg
I need to access to properties from 'Element Browser -> Browser & Results -> Advanced tab'. You can take a look at the image that I attached in my first post - for example, I would like to access the following properties: Text, Variable and Size.

Re: How to access Advanced Properties of object

Posted: Wed Nov 05, 2014 2:26 pm
by krstcs
First, is the application open and the NumField visible when you try to select the attribute to match? If not, Ranorex will not be able to know what advanced fields are available.

Second, you can just type in the name of the attribute "Text" in the Match Name drop-down's text area. Ranorex only lists the attributes it can currently see, but you can type anything in there.

Re: How to access Advanced Properties of object

Posted: Thu Nov 06, 2014 12:00 am
by bewiss
Did you try to get your attribute via usercode and the getAttributeValue method?

1. Create a Code- or Recording-module
2. drag and drop your repo-item into the modules usercode section
3. -->

var yourItem = <yourRepoInstance><yourRepoItem>
string yourValue = yourItem.getAttributeValue("Text").toString();

4. replace "Text" with the property RR-Spy offers you within the element browser
5. Make sure it is an "Element" you are working with (in your example it is), otherwise "getAttributeValue" won't work (IntelliSens will not offer getAttributeValue). In this case go for yourItem.ELEMENT.getAttributeValue(<youProperty>).toString();

Re: How to access Advanced Properties of object

Posted: Thu Nov 06, 2014 10:29 am
by marasanov
Thank you krstcs and bewiss. Both of your solutions work.