how to handle websites for different environment tests

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

how to handle websites for different environment tests

Post by fimo420 » Wed Jun 12, 2013 10:33 am

Hi,

I'm having this big issue to understand how to do some webb test on different environments.
The problem is that once i change the base url all other components are not found, which is the way it should be. But how have you guys solved this issue?

for ex:
http://Testeinvironment1
http://Testeinvironment2

My tests works perfectly fine on testsite1, but fails on testsite2.

I've tried to do a variable on baselevel but it doesnt work for me.
It just doesnt find the underlying components of the base url
Here is my code:

GPRepository.cs:

Code: Select all

#region Variables

        string _pageurl = "";

        /// <summary>
        /// Gets or sets the value of variable pageurl.
        /// </summary>
        [TestVariable("48b7508f-532a-46b6-babe-b55b24037c9b")]
        public string pageurl
        {
            get { return _pageurl; }
            set { _pageurl = value; }
        }

#endregion
Then i try to change pageurl from my methods, setting to environment2.

Code: Select all

private static GPRepository repo = GPRepository.Instance;
  Pageurl = "http://Testeinvironment2";
  public static string Pageurl
        {
            get { return repo.pageurl; }
            set { repo.pageurl = value; }
        }

I'm missing something, but cannot find what :(
Would really appreciate the help.

Br,
Feroz

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: how to handle websites for different environment tests

Post by fimo420 » Wed Jun 12, 2013 11:45 am

think i know what i did wrong :)
i wrote the damn domain adress with http://Testeinvironment2
i should write Testeinvironment2 only.

So, case closed :)