Need Index value of a form element

Experiences, small talk, and other automation gossip.
faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Need Index value of a form element

Post by faheem412 » Wed Dec 27, 2017 12:27 pm

Hi Team

In my application data is arranged as a form in rows and columns .However these are not structured in table.
How can we identify a specific element using index property ?

Could you please help me on this?

Regards
Faheem

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

Re: Need Index value of a form element

Post by odklizec » Wed Dec 27, 2017 12:54 pm

Hi,

Unfortunately, without, at very least, a Ranorex snapshot, it’s pretty hard to suggest something reliable. Could you please create and upload one? Thanks.
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

faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Re: Need Index value of a form element

Post by faheem412 » Wed Dec 27, 2017 1:43 pm

Please refer the snapshot

We tried to get the index value by using GetattributeText("index" ) method.However its returning the value as null

Please advice
You do not have the required permissions to view the files attached to this post.

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

Re: Need Index value of a form element

Post by odklizec » Wed Dec 27, 2017 2:04 pm

At first, what you have posted is not a snapshot but screenshot. Please learn how to create the snapshot here:
https://www.ranorex.com/help/latest/les ... shot-files

As for getting the value of an element attribute, use method GetAttributeValueText.
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

faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Re: Need Index value of a form element

Post by faheem412 » Wed Dec 27, 2017 3:13 pm

Sorry for posting screenshot instead of Snapshot.
And as suggested, we have tried with GetAttributeValueText("index" ) method also, but still it is returning value as 'null'.

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

Re: Need Index value of a form element

Post by odklizec » Wed Dec 27, 2017 10:48 pm

As mentioned, please post a Ranorex snapshot of the problematic element. Without snapshot, there is not much anyone here can do or suggest.

On the other hand, I don’t think that using index number is the best way to identify elements. In fact, it’s least realiable one :) So in my opinion, you will have to find other way to identify the element in question (e.g. using parent/children relationship).
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

faheem412
Posts: 13
Joined: Tue Oct 10, 2017 8:52 am

Re: Need Index value of a form element

Post by faheem412 » Fri Dec 29, 2017 4:37 pm

Thanks much for the comment.

And we identified that we can get the index value of object using property "childindex".It returned value '57' for the below screenshot.
And yes, it is not that much reliable to use index property, but the AUT does not have proper hierarchy.