Base URL Testing

5 posts, 0 answers
  1. LEONARD
    LEONARD avatar
    24 posts
    Member since:
    Aug 2012

    Posted 13 May 2013 Link to this post

    Currently I am maintaining 3 different Test Lists that are are the same except for the enviroment they are meant to test. one is qa, one stage and the final is Prod.  Our URLs vary depending on the enviroment we are trying to access. I have investigated using the BASE URL function when a base URL is entered I get the "/" in my navigation step however when I try to modify the navigation URL for playback my test fails.  I believe this is due to the parameters before the base URL being the one I need to change not the ones after the URL.

    Example: 
    1. Movies.com is my base URL 
    2. I want to hit a page of my site hollywood.movies.com 

    The paremeters change before the base.  After watching the video here: http://tv.telerik.com/watch/automated-testing-tools/setting-base-url-in-webui-test-studio  it looks like base URL can only handle parameters after the base.   Has anyone run into this issue before or is there a known workaround that I am not finding.

    Most of the sites I test have similar URL structures which will make maintenance of my test plans cumbersome. 


                   
  2. Rodney
    Admin
    Rodney avatar
    6 posts

    Posted 16 May 2013 Link to this post

    Hi Robert,

    Thank you Robert for providing that information. As Robert stated, there is an active feature request for this issue. You can vote for its inclusion in future releases at this link:
    Public URL

    Leonard, if you would like to create a support ticket, and attach a demo project that includes an example of all the components in your work scenario, I will be happy to take a look at it to see if there is anything else we can do. If there are any useful details, I can update the thread so that everyone benefits.


    Kind Regards,
    Rodney
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Bob
    Bob avatar
    39 posts
    Member since:
    Apr 2013

    Posted 17 May 2013 Link to this post

    Leonard.

    I'm running the same test lists in every environment. I've written up a test that allows you to emulate the "BaseURL" property to work around this issue for now. You'll need to modify Step 2 in this test before running the test list to contain whatever prefix you want to add to the URL.

    \\

    Generate a Variable Prefix:
    1) Navigate to - http://www.google.com/
    2) Enter Text "" into Search Field (This is where you enter the prefix to your URL. Example: Hollywood)
    3) Extract input Search Field into DataBind $(prefix)

    Navigate to Site with Prefix - Coded Step - Use for every navigation step - I have my URL navigations in subtests
    ' Turn the extracted DataBind into a variable
    Dim urlPrefix As Object = GetExtractedValue("prefix")
    ' Navigate to http:// <prefix variable> .movies.com
    ActiveBrowser.NavigateTo("http://" & urlPrefix & ".movies.com", true)

    \\

    Alternatively, if you want to run your test against a group of environments, you could DataBind a spreadsheet with each subdomain in a single column, though if you go with this method, you'll need to copy your "BaseURL" test steps into every test because of the way Test Studio executes DataBindings of Subtests (should be a feature: option to run a subtest with DataBinds from the parent test so that the steps can be duplicated within the same test or used in other tests)
  4. LEONARD
    LEONARD avatar
    24 posts
    Member since:
    Aug 2012

    Posted 17 May 2013 Link to this post

    Thanks Robert I will try your solution. 

    I do employ a databind test which runs through most of my sites homepages it works like a charm when the enviroment is the same however our qa and staging site url format muddles with this so I would end up maintaining seperate spread sheets for all enviroments. That could however be a faster solution then changing test cases individually. 
Back to Top