Regular expression is not working.
Hi guys
Need help to solve one issue, I recorded one script 2 months back that time my session name was recorded “2008_0514_xyz”. Now today if I run my script then it throws the error stating “<property mismatch>” because today it created session name “2008_0714_xyz”. (months changed)
how am I supposed to handle this issue?
I tried to use regular expression (“.*2008_0514_xyz”) but still it is failing.
my script is:[COLOR="DarkRed"] Browser(Browser).page(page_1).linck(“2008_0514_xyz”).click[/COLOR]
Thanks in advance.
Ema
Re: Regular expression is not working.
[QUOTE=emaraj;32926]Hi guys
Need help to solve one issue, I recorded one script 2 months back that time my session name was recorded “2008_0514_xyz”. Now today if I run my script then it throws the error stating “<property mismatch>” because today it created session name “2008_0714_xyz”. (months changed)
how am I supposed to handle this issue?
I tried to use regular expression (“.*2008_0514_xyz”) but still it is failing.
my script is:[COLOR="DarkRed"] Browser(Browser).page(page_1).linck(“2008_0514_xyz”).click[/COLOR]
Thanks in advance.
Ema[/QUOTE]
Please check the Property of the linck Control, which has the constant string value i.e "2008_0514_xyz", I would suggest to use 2008_0\d{3}_xyz for that property.
Regards,
Nawab
Re: Regular expression is not working.
[QUOTE=NawabShaikh;32932]Please check the Property of the linck Control, which has the constant string value i.e "2008_0514_xyz", I would suggest to use 2008_0\d{3}_xyz for that property.
Regards,
Nawab[/QUOTE]
Hi Nawab thanks for your reply i tried as you said but still it is not working. It is throwing error "property mismatch".
please help me
Re: Regular expression is not working.
Hi Nawab
I tried "2008_\([1-12]\)18_xyz" but still it is failling. Please tell me where am i doing mistake?
Thanks
Ema
Re: Regular expression is not working.
Please ensure that while you make a property as a regular expression, u select the checkbox(regular expression)...hence only in that case the string will parsed as a regular expression in QTP.
if nothing works then go for *.* :o
E.g if there is a string value OSTD_45_T
and here I am sure that 45 is a variant component....then
the property of the control that holds the string value , suppose text..
text = OSTD_\d{2}_T else OSTD_\d{1,}_T else OSTD_*.*_T
there is a checkbox which ask that u want to nake it a regular expression...just select that...and its done..
please revert in case there are issues.
Regards,
Nawab
Re: Regular expression is not working.
Hi Nawab
Thanks for your help but still my script is throwing error of mismatch property.
I did check the check box.
Below I am trying to explain my page.
On my web page, first, I record year '2008' then date from the calendar box '06/18' then program area and hit on the 'Create' button so system generate the session name "2008_0618_xyz". But when I run this script after a month then it is throwing error because month is change. So when I run today then it create the session name '2008_0718_xyz' and match with the existing script which has session name”2008_0618_xyz”. Because month is changed so system throws the error of mismatch property.
Script is:
[COLOR="DarkRed"]Browser (browser).page (page).link ("2008_0618_xyz").click[/COLOR]
I went to the object property of this line and entered the regular expression; I did check the check box and click 'yes'. I can see the blue color box near the session name on object property box, and then tried to run but still throwing error. I used the regular expression syntax whatever you said to use.
Can you please help me?
Thanks
Ema
Re: Regular expression is not working.
[QUOTE=emaraj;33043]Hi Nawab
Script is:
[COLOR="DarkRed"]Browser (browser).page (page).link ("2008_0618_xyz").click[/COLOR]
[/QUOTE]
Could you please provide the screenshot of Object Repository & the Control as in ur application.
Regards,
Nawab
1 Attachment(s)
Re: Regular expression is not working.
Hi Nawab
Thanks a lot for you help
Attaching screen shot.
Please help me..
Ema