Ways to change url of UI tests

2 posts, 1 answers
  1. ching ping
    ching ping avatar
    3 posts
    Member since:
    Sep 2010

    Posted 15 Nov 2010 Link to this post

    Hi Telerik team,

    We're now creating UI test in our development server. If we would like to change the url to another environment(let's say our staging or production server), what we currently do is,

    1. change the URL that is pointing to development server originally to the new url
    2. change all the pages references' base url manually

    It takes us around 15 minutes to convert one test from pointing to development URL to staging/production url. If we have 10 tests, we'll need around 1hour 30 minutes to do it.

    Is there any easier and faster way to do this instead of changing the url and reference manually 1 by 1?

    The reason we're doing this is, we can run our UI tests to check everything after delopyment to staging/production instead of checking it manually.

    Please advice. Thanks
  2. Answer
    Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 15 Nov 2010 Link to this post

    Hi Ching Ping,

       Thank you for choosing our product!
    Your situation is a very typical use case. WebUI Test Studio uses the concept of Base Url: you can record your entire test using relative URLs with an eye to running the same test against different servers later on.

    Here's how it works: before you start recording your test, open the user setting (screenshot 1). Choose Recording Options from the menu on the right and enter your Base URL which will be the URL of the server on which you will initially record your test (screenshot 2). As you can see in the screenshot, I've ented "http://www.google.com" (Make sure you enter the complete URL - http, www and everything else).
    Now when I start record and navigate to "http://www.google.com", my test step gets record only as "/" becase I'm navigating relative to my base URL.

    After you're done you can change your Base URL from the same menu (User Settings) and execute your test against a different server. For instance if you give "http://www.wikipedia.org" as your Base URL, the step "Navigate to '/' " would be execute as "Navigate to http://www.wikipedia.org" .

    However, this only works if you execute your test using "Quick Execution". 

    To execute your test from the Test View you will have to change the Base URL from the testsettings file (screenshot 3). You can find the testsettings file in the Solution Explorer - just double click it open the menu. Local.testsettings is the default testsettings file but you can also create custom testsettings file and use them for different test runs.

    Again, this is a very common use can and you can find plenty of info if you dig around our site. For instance here is a thread answering a similar question. Unfortunately it's a bit old but you still might find it useful:
    http://www.telerik.com/community/forums/automated-testing/general-discussions/baseurl.aspx

    I hope this helps! Please don't hesitate to contact us if you have any further questions!

    Regards,
    Stoich
    the Telerik team
    See What’s New in WebUI Test Studio’s Q3 Release – Friday, November 19th, 2010 at 11am EST – Register Today!
Back to Top