Solved how to indentify a element using Reg Ex ?

johnsonf1513

New Member
Thanks. Is there any example for this ? I am not familiar with regular expression. For example, if my html code is
/HTML/BODY(1)/FORM(1)/TABLE(1)/TBODY(1)/TR(2)/TD(1)/DIV(1)/DIV(1)/CENTER(1)/TABLE(1)/TBODY(1)/TR(3)/TD(2)/INPUT(1)

The <DIV> is a dynamic number between 4 and 5, so the Reg Ex will be ?
"/HTML/BODY(1)/FORM(1)/TABLE(1)/TBODY(1)/TR(2)/TD(1)/DIV("&"[4-5]"&")/DIV(1)/CENTER(1)/TABLE(1)/TBODY(1)/TR(3)/TD(2)/INPUT(1)"

is this the right way ?
 
Last edited:

DanielTorres

New Member
\/HTML\/BODY\(1\)\/FORM\(1\)\/TABLE\(1\)\/TBODY\(1\)\/TR\(2\)\/TD\(1\)\/DIV\([4-5]\)\/DIV\(1\)\/CENTER\(1\)\/TABLE\(1\)\/TBODY\(1\)\/TR\(3\)\/TD\(2\)\/INPUT\(1\)
 

Sasi

New Member
Hi Daniel Torres, I tried to apply this for a long path but it is taking 4 - 5 mins to identify this field. Is there any alternative to this or it gets worst when it gets longer ?
 

DanielTorres

New Member
Maybe use the path, you can adopt another strategy.
Look for something that does not vary and is unique in the element you want to identify.
 

VJR

Well-Known Member
One of the options is to use the Dynamic Match feature for identifying an element. Similar to the Regex option, select Dynamic in the dropdown and then in a Read (Write or Navigate) stage click on the button having the three dots and pass the parameter with the html DIV paths for 4 and 5 (either in a loop or separately). You can try and check out which one is faster in your situation and make a decision.
 
Top