Object Identification based on control id

Ask general questions here.
samp
Posts: 4
Joined: Wed Apr 06, 2011 1:42 pm

Object Identification based on control id

Post by samp » Wed Apr 06, 2011 1:53 pm

Hi,

I have a Xpath like
"/form[@title='Incoming Shipment']/element/element[@controlid='39851744']/element[@controlid='10']/combobox[@accessiblerole='ComboBox']"

In this Xpath, "[@controlid='39851744']" , the value part (39851744) changes every time the form is launched.Because of this I am getting "Element no found exception" within 30 seconds.


Please let me know how to handle the element id problem.

Regards,
Sam

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

Re: Object Identification based on control id

Post by Support Team » Wed Apr 06, 2011 2:06 pm

Hi,

have a look at following blog post, which will show you how to eliminate such dinamically generated attributes from your RanoreXPath:
http://www.ranorex.com/blog/eliminate-d ... norexpaths

Regards,
Tobias
Support Team
.
Image

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Object Identification based on control id

Post by atom » Wed Apr 06, 2011 4:52 pm

Or eliminate it manually to :

"/form[@title='Incoming Shipment']/element/element/element[@controlid='10']/combobox[@accessiblerole='ComboBox']"

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

Re: Object Identification based on control id

Post by Support Team » Thu Apr 07, 2011 7:55 am

Hi atom,

of course you can eliminate it manually, but I think it is really annoying if you have to adapt your RxPath after each Recording. Therefore I would also suggest you the way with the "Weights", because even then the recorder ignores this attributes.

Regards,
Peter
Ranorex Team
.
Image

samp
Posts: 4
Joined: Wed Apr 06, 2011 1:42 pm

Re: Object Identification based on control id

Post by samp » Sat Apr 09, 2011 9:55 am

Support Team wrote:Hi atom,

of course you can eliminate it manually, but I think it is really annoying if you have to adapt your RxPath after each Recording. Therefore I would also suggest you the way with the "Weights", because even then the recorder ignores this attributes.

Regards,
Peter
Ranorex Team

Hi ,

I have used regural expression and achived the required functionality
I have used "[@controlid~'[\d{8}]']" instead of "[@controlid='39851744']"

Thanks for your support