Ask a Question

Help when testing between 2 environments

SOLVED
david_munro
Occasional Contributor

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.


1 ACCEPTED SOLUTION

Accepted Solutions
todd_james
Contributor

RE: Help when testing between 2 environments

We normally remove the URL from the properties used to identify the object as we run the same scripts across multiple environments.



Another option would be to use wildcards in the URL property as shown here: http://support.smartbear.com/viewarticle/54937/#InNameMapping

View solution in original post

5 REPLIES 5
todd_james
Contributor

RE: Help when testing between 2 environments

We normally remove the URL from the properties used to identify the object as we run the same scripts across multiple environments.



Another option would be to use wildcards in the URL property as shown here: http://support.smartbear.com/viewarticle/54937/#InNameMapping

View solution in original post

david_munro
Occasional Contributor

RE: Help when testing between 2 environments

Thanks Todd.



How do I set up the first option?



D.
Colin_McCrae
Community Hero

RE: Help when testing between 2 environments

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.
david_munro
Occasional Contributor

RE: Help when testing between 2 environments

Thanks Colin.



Where can I set a global variable?



D.
Colin_McCrae
Community Hero

RE: Help when testing between 2 environments

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".
cancel
Showing results for 
Search instead for 
Did you mean: