Micro Focus QTP (UFT) Forums
Help modifying a recorded QTP script? - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Help modifying a recorded QTP script? (/Thread-Help-modifying-a-recorded-QTP-script)



Help modifying a recorded QTP script? - sunnyvale69 - 12-16-2009

Hi - My web application is pretty simple. Login and click an order number. I recorded below script for Order# 434500. When I try to change the script for a different order number(434501) it does not work (complains The "434501" Link Object was not found in the Object Repository. Check the Object Property to confirm that the object exists or to find the correct name for the object)...

Could someone help me? The only thing I changed in the below script is "change 434500 to 434501"..That's it...

Code:
Browser("Acme - Welcome").Page("Acme - Welcome").WebEdit("uid").Set "qauser"
Browser("Acme - Welcome").Page("Orders 3.0 - Welcome").WebEdit("pwd").Set "password"
Browser("Acme - Welcome").Page("Orders - Welcome").WebEdit("pwd").Submit
Browser("Acme - Welcome").Page("Orders").Link("Orders").Click
Browser("Acme - Welcome").Page("Acme • Orders_2").Link("434500").Click
Browser("Acme - Welcome").Page("Acme • Orders_3").Link("Logout").Click
Browser("Acme - Welcome").Page("Acme - Welcome_2").Sync
Browser("Acme - Welcome").Close[hr]
BTW, I am changing the above order in Expert View (eventhough I am not the expert Smile )


RE: Help modifying a recorded QTP script? - Yong - 01-07-2010

Only change the code in expert view is not enough, you need to change the corresponding repository from 434500 to 434501.


RE: Help modifying a recorded QTP script? - Saket - 01-07-2010

better regularise it to work it for any order that you get there. serach this forum to know more on 'Regular Expression'