Unable to Play Back in QTP
I recorded one scenario lets say for example Incomming Email messages. When recording, the email box might show 10 emails new. When I re-run the same it tunrs out to be 20. How do you take care of this situation ? what testing methodology should be used? Can anyone explain?
Re: Unable to Play Back in QTP
Have you received any new e-mail since you last recorded your script?
Re: Unable to Play Back in QTP
Yes New emails are received. It fails while reexecuting bcos the old count was 10 new is 14. Its failing.
Re: Unable to Play Back in QTP
You can substitute the recorded value (10 -> [0-9]+) with a regular expression so no matter what the value is, it will pass.
Re: Unable to Play Back in QTP
Will the expression work if it goes beyond 100 emails too? What kind of programming technique is this? Can u please elaborate this? I mean nowin my case it is 10 if I receive more than 100emails since its testing... will the below expression 10-> 0-9+work? Iam just curious
Re: Unable to Play Back in QTP
Hi,
To just add to what Anshoo has already answered to use Regular expressions,
Incase you wish to proceed further than 100 mails, enhance your regular expression to contain [0-9][0-9] and further on.....
Cheers...
Re: Unable to Play Back in QTP
You can use [0-9]+ or \d+ to match any whole number.