Search code examples
qtp

Using same QTP script for 2 different environments


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?

Thanks for any helpful tips. This forum has been extremely helpful to me this entire week and I am grateful.


Solution

  • I don't see why you need the URL in the Pages description, pages don't usually have any description whatsoever.

    Wouldn't the same object repository work for production and testing environments depending on which is open? Just navigate to a parametrized URL at the beginning of the test and everything else should work.