How to access Advanced Properties of object

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
marasanov
Posts: 8
Joined: Thu Oct 30, 2014 2:40 pm

How to access Advanced Properties of object

Post by marasanov » Thu Oct 30, 2014 2:57 pm

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.
Attachments
advanced_property.png
advanced_property.png (133.16 KiB) Viewed 1543 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to access Advanced Properties of object

Post by Support Team » Tue Nov 04, 2014 2:13 pm

Hello marasanov,

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

marasanov
Posts: 8
Joined: Thu Oct 30, 2014 2:40 pm

Re: How to access Advanced Properties of object

Post by marasanov » Wed Nov 05, 2014 11:37 am

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
properties.jpg (52.84 KiB) Viewed 1520 times
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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to access Advanced Properties of object

Post by krstcs » Wed Nov 05, 2014 2:26 pm

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.
Shortcuts usually aren't...

bewiss
Posts: 16
Joined: Mon Feb 24, 2014 3:11 pm

Re: How to access Advanced Properties of object

Post by bewiss » Thu Nov 06, 2014 12:00 am

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();

marasanov
Posts: 8
Joined: Thu Oct 30, 2014 2:40 pm

Re: How to access Advanced Properties of object

Post by marasanov » Thu Nov 06, 2014 10:29 am

Thank you krstcs and bewiss. Both of your solutions work.