Hi Team,
We are facing an issue with Dynamic Id , where it is changing from time to time and Machine to machine
could please help me out here.
following unique Id is changing from time to time, I have added a screen shot for the same
#'uniqName_130_0'
//div[#'uniqName_130_0']/div/div[6]//table/tbody/tr[7]/td[@innertext='APPLICATION MENUS']
I have tried for the following ways by adding a condition for wights with ranorex tool from previous posts
uniqName_([0-9])*
uniqName_([0-9]+)+
uniqName_[0-9]*_[0-9]*
still they didn't work for me
Please Provide some suggestions here
Facing a problem with dynamic Id in RanoRex Path
Facing a problem with dynamic Id in RanoRex Path
You do not have the required permissions to view the files attached to this post.
Re: Facing a problem with dynamic Id in RanoRex Path
Hi,
I would suggest using a regular expression in the path. For example, you could use the following path:
//div[@Id~'^uniqName']/div/div[6]//table/tbody/tr[7]/td[@innertext='APPLICATION MENUS']
More information about regular expressions can be found in the user guide: https://www.ranorex.com/support/user-gu ... html#c3294
I hope that helps.
I would suggest using a regular expression in the path. For example, you could use the following path:
//div[@Id~'^uniqName']/div/div[6]//table/tbody/tr[7]/td[@innertext='APPLICATION MENUS']
More information about regular expressions can be found in the user guide: https://www.ranorex.com/support/user-gu ... html#c3294
I hope that helps.
Re: Facing a problem with dynamic Id in RanoRex Path
Hi jma,
I have tried with the above suggestion and applied few Regex still its not finding the required element on a browser.
can get some more suggestions over here
I have tried with the above suggestion and applied few Regex still its not finding the required element on a browser.
can get some more suggestions over here
Re: Facing a problem with dynamic Id in RanoRex Path
Hi Team,
In our Application there are Multiple unique Ids for a single page on each and every Div as shown in screenshot,
I need to access elements under each and every Div, Can I get some suggestions for proceeding further
I have Edited the Ranorex Path as Per Jma's Suggestions and even added few RegEx to find the required element but its unable to find the required element.
Please Provide me some suggestions ASAP.
Thanks
In our Application there are Multiple unique Ids for a single page on each and every Div as shown in screenshot,
I need to access elements under each and every Div, Can I get some suggestions for proceeding further
I have Edited the Ranorex Path as Per Jma's Suggestions and even added few RegEx to find the required element but its unable to find the required element.
Please Provide me some suggestions ASAP.
Thanks
Re: Facing a problem with dynamic Id in RanoRex Path
Hi,
In order the community can help you resolving your issues, please upload a Ranorex Snapshot of the corresponding web element.
Information about creating a snapshot can be found under the following link: https://www.ranorex.com/support/user-gu ... pshot.html
After that, I can check why my path suggestion doesn't work.
In order the community can help you resolving your issues, please upload a Ranorex Snapshot of the corresponding web element.
Information about creating a snapshot can be found under the following link: https://www.ranorex.com/support/user-gu ... pshot.html
After that, I can check why my path suggestion doesn't work.
Re: Facing a problem with dynamic Id in RanoRex Path
Hi Jma,
As per security and Privacy guidelines i am not supposed to add the snapshot as you ask, but i am attaching the architecture of the required button screenshot.
//div[#'uniqName_130_1']/div/div[6]/div/div/div/div[13]/input[@type='button']
please find the attached screenshots for the same
in Snap Shot there are two snaps one is from top level parent and second one is continuation till the required button
As per security and Privacy guidelines i am not supposed to add the snapshot as you ask, but i am attaching the architecture of the required button screenshot.
//div[#'uniqName_130_1']/div/div[6]/div/div/div/div[13]/input[@type='button']
please find the attached screenshots for the same
in Snap Shot there are two snaps one is from top level parent and second one is continuation till the required button
You do not have the required permissions to view the files attached to this post.
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Facing a problem with dynamic Id in RanoRex Path
This is really challenging without the snapshot, but I completely understand why you can't provide it. Sometimes it can help to start backwards. For example how many elements do you get when you use just
Code: Select all
//td[@innertext='APPLICATION MENUS']
Doug Vaughan
Re: Facing a problem with dynamic Id in RanoRex Path
Hi,
Unfortunately, a screenshot is useless here. It does not provide enough information about the problematic xpath and it does not allow us to test it. If the regex you are trying is correct, then there must be a problem with something else in your xpath (my guess div indexes). But without the ability to test the xpath and regexes against the snapshot, there is almost nothing anyone here can do, except wild guesses. If you are not allowed to post a snapshot publicly, try contact Ranorex support at [email protected]. They may help you via remote session.
Anyway, I would suggest you to check this blog post, describing how to work with dynamic IDs:
https://www.ranorex.com/blog/automated- ... namic-ids/
Maybe it would be better for you to use another identification attributes (e.g. class), instead of "not-so-unique" IDs
Unfortunately, a screenshot is useless here. It does not provide enough information about the problematic xpath and it does not allow us to test it. If the regex you are trying is correct, then there must be a problem with something else in your xpath (my guess div indexes). But without the ability to test the xpath and regexes against the snapshot, there is almost nothing anyone here can do, except wild guesses. If you are not allowed to post a snapshot publicly, try contact Ranorex support at [email protected]. They may help you via remote session.
Anyway, I would suggest you to check this blog post, describing how to work with dynamic IDs:
https://www.ranorex.com/blog/automated- ... namic-ids/
Maybe it would be better for you to use another identification attributes (e.g. class), instead of "not-so-unique" IDs

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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