Technology specific object identification, supported applications, web technologies, and 3rd party controls.
-
thecrazykaktus
- Posts: 13
- Joined: Wed Feb 19, 2014 12:24 pm
Post
by thecrazykaktus » Wed Feb 19, 2014 12:38 pm
Hi I have a problem with dynamic IDs. We use the JS Framework.
I have a link witch is a Button that is generated dynamically.
The example can be found here.
Code: Select all
.//div[#'ifrdiv_comcat']/iframe[@id='ifr_comcat']//a[#'form_vertical_toolbar:j_idt112:create']
How can i handle the dynamic ID? I have no other Attribute that i can use.
j_idt112
Is there a method how to
can be replaced by a placeholder or similar?
Like this
Code: Select all
.//div[#'ifrdiv_comcat']/iframe[@id='ifr_comcat']//a[#'form_vertical_toolbar:*~~~:create']
Sorry for my English

-
krstcs
- Ranorex Guru
- Posts: 2683
- Joined: Tue Feb 07, 2012 4:14 pm
- Location: Austin, Texas, USA
Post
by krstcs » Wed Feb 19, 2014 2:19 pm
Regular expressions (RegEx). In RanoreXPath you can use regex to do what you are wanting. Change the "=" to "~" and put the pattern you want to match in the single quotes like so:
Code: Select all
.//div[#'ifrdiv_comcat']/iframe[@id='ifr_comcat']//a[@id~'form_vertical_toolbar\:.*\:create']
(Note that I used the "\" to escape the ":" characters, since they are considered special in regex and we want to match the actual character in your pattern.)
The "#" symbol in RanoreXPath means "unique ID" so you can substitute "@id=" or "@id~", etc.
This will find all atags under the iframe with an id attribute that is similar to 'form_vertical_toolbar:<any id>:create'.
http://www.regular-expressions.info/ is a great site for understanding RegEx.
Shortcuts usually aren't...