Page 1 of 1

Not able to identify TabPage using regular expression

Posted: Tue Oct 13, 2009 1:07 pm
by kiran.pol
I have a tab page something like Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename='Edit Customer [10378456]']";.

The value in the brackets keep changing.Next time it might be something like - Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename='Edit Customer [1045237894]']";

So i am trying to identify the tab page using regular expression something like

Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename='Edit Customer .*']";
but i am getting elementnotfound exception.

Why the regular expression is failing to identify the tab page.

Re: Not able to identify TabPage using regular expression

Posted: Tue Oct 13, 2009 1:40 pm
by devenb
kiran.pol wrote:I have a tab page something like Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename='Edit Customer [10378456]']";.

The value in the brackets keep changing.Next time it might be something like - Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename='Edit Customer [1045237894]']";

So i am trying to identify the tab page using regular expression something like

Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename='Edit Customer .*']";
but i am getting elementnotfound exception.

Why the regular expression is failing to identify the tab page.
Hi Kiran,

Since the accessiblename attribute of the Tab changes in your case, I would suggest you to amend your path to:

Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename~'^Edit\ Customer']";

and check whether the tab can be accessed for different values.

Regards,
Deven B.

Re: Not able to identify TabPage using regular expression

Posted: Tue Oct 13, 2009 2:58 pm
by Support Team
kiran.pol wrote:Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename~'Edit Customer .*']";
You forgot to use the '~' operator instead of '=' in the RxPath attribute comparison. The text will only be interpreted as a regular expression if you use the ~ comparison operator.

Regards,
Alex
Ranorex Support Team

Re: Not able to identify TabPage using regular expression

Posted: Wed Oct 14, 2009 7:42 am
by kiran.pol
Thanks a lot. I definitely missed to use "~"

Now it is working fine for me :)