Geeks Talk

Prepare for your Next Interview




Regular expression is not working.

This is a discussion on Regular expression is not working. within the QTP forums, part of the Software Testing category; 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 ...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-21-2008
Junior Member
 
Join Date: Apr 2008
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
emaraj is on a distinguished road
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 “” 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: Browser(Browser).page(page_1).linck(“2008_0514_xyz”).click

Thanks in advance.

Ema

Last edited by emaraj : 07-21-2008 at 04:55 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-22-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 178
Thanks: 3
Thanked 13 Times in 13 Posts
NawabShaikh is on a distinguished road
Thumbs up Re: Regular expression is not working.

Quote:
Originally Posted by emaraj View Post
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 “” 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: Browser(Browser).page(page_1).linck(“2008_0514_xyz”).click

Thanks in advance.

Ema
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
Reply With Quote
  #3 (permalink)  
Old 07-22-2008
Junior Member
 
Join Date: Apr 2008
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
emaraj is on a distinguished road
Re: Regular expression is not working.

Quote:
Originally Posted by NawabShaikh View Post
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
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
Reply With Quote
  #4 (permalink)  
Old 07-22-2008
Junior Member
 
Join Date: Apr 2008
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
emaraj is on a distinguished road
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
Reply With Quote
  #5 (permalink)  
Old 07-23-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 178
Thanks: 3
Thanked 13 Times in 13 Posts
NawabShaikh is on a distinguished road
Arrow 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 *.*

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
Reply With Quote
  #6 (permalink)  
Old 07-23-2008
Junior Member
 
Join Date: Apr 2008
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
emaraj is on a distinguished road
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:
Browser (browser).page (page).link ("2008_0618_xyz").click

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
Reply With Quote
  #7 (permalink)  
Old 07-24-2008
Expert Member
 
Join Date: Jan 2007
Location: India
Posts: 178
Thanks: 3
Thanked 13 Times in 13 Posts
NawabShaikh is on a distinguished road
Arrow Re: Regular expression is not working.

Quote:
Originally Posted by emaraj View Post
Hi Nawab

Script is:
Browser (browser).page (page).link ("2008_0618_xyz").click

Could you please provide the screenshot of Object Repository & the Control as in ur application.


Regards,
Nawab
Reply With Quote
  #8 (permalink)  
Old 07-24-2008
Junior Member
 
Join Date: Apr 2008
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
emaraj is on a distinguished road
Re: Regular expression is not working.

Hi Nawab

Thanks a lot for you help

Attaching screen shot.

Please help me..

Ema
Attached Images
File Type: jpg regular expression.JPG (164.2 KB, 6 views)

Last edited by emaraj : 07-24-2008 at 10:09 AM.
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Regular Expression in QTP radhika_inala QTP 11 07-09-2008 02:37 PM
Regular expression Euroneem QTP 11 06-19-2008 05:09 AM
regular expression snigdha_123 QTP 1 12-17-2007 07:37 AM
Regular Expression gouthami123 QTP 3 08-17-2007 11:32 AM
What is Regular Expression? JobHelper Testing Issues 1 12-16-2006 07:17 AM


All times are GMT -4. The time now is 07:37 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved