Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Reusing test steps in multiple tests

$
0
0
Hello Misty,

Let me start with a high level explanation how BaseUrl works.

Let's say you have 4 testing environments:
  •  Development
  •  QA
  •  Stage
  •  Production

It's the same application but on 4 different servers with 4 different server address. Thus the login page for each one looks like this:
  • http://dev.server.com/app/login.aspx
  • http://qa.server.com/app/login.aspx
  • http://stage.server.com/app/login.aspx
  • http://prod.server.com/app/login.aspx

BaseURL would be the 4 server URL's:

- http://dev.server.com
- http://qa.server.com
- http://stage.server.com
- http://prod.server.com

Now in your NavigateTo test step you enter separate values as shown in the attached screen shot. To change testing to a different environment simply enter one of the above 4 Base URL values into the test list settings and like magic all of your tests now run against that environment w/o changing any of the tests. What Test Studio is literally doing is discarding the BaseUrl value of the NavigateTo step and replacing it with the BaseUrl value contained in the test list setting. Then it appends the NavigateTo value to that BaseUrl value creating one full and complete URL to actually navigate to.

Does that clarify how this is supposed to work? Another combination that would work is if you left the NavigateTo property empty and put the full URL into the test list settings BaseUrl value, Test Studio would go through the same motions of appending a now empty string to your BaseUrl value and navigate to it. Thus you can completely control what URL would be navigated to this way.

I've tried changing the "Wait On Elements" but that doesn't seem to work or I'm using it incorrectly.

Ah, thanks for that explanation. It's the ClientReadyTimeout value that you need to increase. Test Studio is timing out waiting for the browser to return to a "Ready" state, when it's done downloading the main HTML page plus all supporting files (css, js, png, etc.).

If you prefer to stick with your code, we can certainly do that. We'll just have to modify the code to read the BaseUrl value from the test list settings like this:

ActiveBrowser.NavigateTo(Settings.Current.Web.BaseUrl + "/default.aspx?local=1", true);

Using the above code you want to set your BaseUrl to "https://allegiant-test.comply365.net".

Or

ActiveBrowser.NavigateTo(Settings.Current.Web.BaseUrl , true);

Using the above code you would want to set your BaseUrl to "https://allegiant-test.comply365.net/default.aspx?local=1".
Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>