Micro Focus QTP (UFT) Forums

Full Version: How to update code/data at run time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I'm recording & running on yahoo site mail inbox.Code is below

Code:
SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","","C:\Documents and Settings","open"
Browser("Browser").Page("Page").Sync
Browser("Browser").Navigate "http://www.yahoomail.com/"
Browser("Browser").Page("Yahoo! Mail: The best").WebEdit("login").Set "user"
Browser("Browser").Page("Yahoo! Mail: The best").WebEdit("passwd").Set "Mercury"
Browser("Browser").Page("Yahoo! Mail: The best").WebButton("Sign In").Click
[b][color=#FF0000]Browser("Browser").Page("Yahoo! Mail - user@yahoo").Link("Inbox(4)").Click[/color][/b]
Browser("Browser").Page("Yahoo! Mail - user@yahoo_2").Link("tutorials site").Click
Browser("Browser").Page("Yahoo! Mail - user@yahoo_3").WebButton("Compose").Click

The question is when i signed in, my inbox had 4 mail.I checked and composed mail and logged out.Now again i runned my application but this time number of mails in Inbox has changed because of that my test failed.What should i do.

Thanks in Advance,
Use Regular Expression. Go to object repository, choose the object properties for Link object. Change Inbox(4) to Inbox(.*) and check the option for Regular Expression. A pop up will be displayed, select No.

Your test should run fine now.
Thanks Ankur, My code worked fine..I've changed the text property as Inbox(.*) as a reular expression and name to Inbox(.*) and It worked.