Page 1 of 1

Object Identification based on control id

Posted: Wed Apr 06, 2011 1:53 pm
by samp
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

Re: Object Identification based on control id

Posted: Wed Apr 06, 2011 2:06 pm
by Support Team
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

Re: Object Identification based on control id

Posted: Wed Apr 06, 2011 4:52 pm
by atom
Or eliminate it manually to :

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

Re: Object Identification based on control id

Posted: Thu Apr 07, 2011 7:55 am
by Support Team
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

Re: Object Identification based on control id

Posted: Sat Apr 09, 2011 9:55 am
by samp
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