Team,
We have some objects RxPath starts with the following:
body/form/div[2]/div[@id='00_Home']/
I know how to use RegEx for this (div[@id='00_Home']/) DIV TAG.
How can I do for div[2]/
Since there are cases, other RxPath is similar in few objects in my application, only this is changing, is there a way to do like this -- div[2|3|4]/ OR div[0-9]/, but its not been accepted by the Tool.
Regards,
Dal...
Regular Expression on DIV TAG
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Regular Expression on DIV TAG
Hi,
the RegExps evaluation only works for comparisions on attributes. But you can use the attribute child index for your objects. The only thing to be carefull with is the fact, that the attribute childindex starts at '0' not at '1' as in the array-style notation you tried to use. So for div[2]/ you have to write div[@childindex='1']/.
Regards
Tobias
Ranorex Team
the RegExps evaluation only works for comparisions on attributes. But you can use the attribute child index for your objects. The only thing to be carefull with is the fact, that the attribute childindex starts at '0' not at '1' as in the array-style notation you tried to use. So for div[2]/ you have to write div[@childindex='1']/.
Regards
Tobias
Ranorex Team
Re: Regular Expression on DIV TAG
but the issue if i use the Childindex the project didn't run do you know what is the soultion
Re: Regular Expression on DIV TAG
Hi,
May I ask you to send us more information about the issue?
Where do you use the childindex, for which element and what exactly didn't run?
Do you get an exception when you run the solution?
If yes, could you send us the message?
Thanks,
Markus
May I ask you to send us more information about the issue?
Where do you use the childindex, for which element and what exactly didn't run?
Do you get an exception when you run the solution?
If yes, could you send us the message?
Thanks,
Markus
Re: Regular Expression on DIV TAG
If there is only one div with @id='00_Home' attribute, then you could just delete the index like this:
old:
body/form/div[2]/div[@id='00_Home']/
new:
body/form/div/div[@id='00_Home']/
Ranorex will now go and search the elements on the body/form/div/div path, and gives the first catch, that has the attribute @id='00_Home'
Hope this helps
old:
body/form/div[2]/div[@id='00_Home']/
new:
body/form/div/div[@id='00_Home']/
Ranorex will now go and search the elements on the body/form/div/div path, and gives the first catch, that has the attribute @id='00_Home'
Hope this helps
