Use same QTP script for 2 different environments - 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: Use same QTP script for 2 different environments (/Thread-Use-same-QTP-script-for-2-different-environments) |
Use same QTP script for 2 different environments - flexdev - 05-18-2012 I wrote a script that points to my QA environment URL; it works great. I assume I can use the same script to point to my PROD environment URL simply by using parameterization. I added an "Environment" column to the Data Table with two values; the URL for QA and the URL for PROD. I started by adding a description property to each Page object (via Object Repository) and parameterize the "url". When I started this I quickly found this could take quite awhile and thought there might be a better way; is there? In addition, I have close to 70 actions, each of which uses a "Page" and "Page 2" object. Hopefully, there is just one place where I can switch the URLs for these two objects: Is there? Is the answer to use user-defined environment variables, i.e. one for QA and one for PROD? Thanks for any helpful tips. RE: Use same QTP script for 2 different environments - sshukla12 - 05-21-2012 Hi, USe MAp repository parameters to handle the 2 different pages but code will work with 1 page name (logical name) but based on the parametrization u can handle it very well. Regards, Sankalp |