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.
Not able to identify TabPage using regular expression
Re: Not able to identify TabPage using regular expression
Hi Kiran,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.
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.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Not able to identify TabPage using regular expression
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.kiran.pol wrote:Ranorex.TabPage TB_Edit_Customer = "/form[@controlname='MainForm']/container[@controlname='panelTabControlHolder']/*/*/tabpage[@accessiblename~'Edit Customer .*']";
Regards,
Alex
Ranorex Support Team
Re: Not able to identify TabPage using regular expression
Thanks a lot. I definitely missed to use "~"
Now it is working fine for me
Now it is working fine for me