Micro Focus QTP (UFT) Forums
How to update code/data at run time - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: How to update code/data at run time (/Thread-How-to-update-code-data-at-run-time)



How to update code/data at run time - newqtp - 01-13-2008

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,


RE: How to update code/data at run time - Ankur - 01-13-2008

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.


RE: How to update code/data at run time - newqtp - 01-14-2008

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.