Forum Discussion

david_munro's avatar
david_munro
Occasional Contributor
10 years ago
Solved

Help when testing between 2 environments


I need help here. We have a product that publishes a webiste and gives it a unique URL.



The problem is when we publish the page in a new release on the test environment the URL changes. 



This causes a problem because 1, the page cannot be found and any linked objects cannot be found either.



For example:



Test on R1 = URL dsofhdkasjfhasdfkljh Object HotSpot6



Test on R2 = URL oldfhjdklshsdljh;ldhji Object HotSpot6



Granted the URL is different but it still can't find the object.



How can I eassily update the URL's for the tests and have the objects updated too?



Thanks



D.


5 Replies

  • My stuff has to run cross browser, and in multiple environments.



    I use a global variable to store the base URL for the current run. The name mapped items, and anywhere it's used in the script, use this value. It can also contain wildcards.



    For example, a page in my name map will use two properties to identify itself.



    The first is the URL which uses the global variable and tends just to be the base part of the URL used through out the site (eg - http://website.com/* ) with a * wildcard on the end. The second property is the ObjectIdentifier. Which is just the URL again. Except in this case the base part of the URL is wildcarded. (eg: *section1/page1 ). So the two value combined uniquely identify the page as - http://website.com/section1/page1



    I also store a page for global objects common throughout the site that only uses the base URL. That way any controls common on multiple pages can be stored against a single page object with all the global controls attached to it. Saves having to map what is effectively the same control time after time and means distinct pages only contain their distinct objects.



    As I also use a keyword and data driven framework, the value is set by the user and can be changed during the run if required.



    Works well.
  • There is a tab for them inside the main project setting tab.



    Go into the tab for the project and look at the bottom tab. One of them is "Variables".