Parameterized Tests

4 posts, 0 answers
  1. Stephen
    Stephen avatar
    23 posts
    Member since:
    Feb 2014

    Posted 26 Mar 2014 Link to this post

    Hi All,

    I am trying to parameterize the BaseURL of my TestStudio tests.  For example, I want to set the BaseURL to an IP Address which may vary depending upon the test configuration.  How do I get the TestStudio playback to actually browse to the BaseURL which is defined in my xml file?

    Does anyone have an example similar to this that you could share?

    For example, take the following XML file:

    <TestSettings>
    <BaseURL>http://10.1.1.1/</BaseURL>
    </TestSettings>

    I have bound the Test to <TestSettings>.  I tried using the "Data Driven Bindings" to the the BaseURL and I also tried setting the  "NavigateURL" to my xml element, but neither seems to work.  I've also tried setting the BaseURL to $(BaseURL) in the test step, but this does not work either.  I end up getting results similar to the following:


    Overall Result: Fail
    ------------------------------------------------------------
    '3/26/2014 2:15:42 PM' - Using 'InternetExplorer' version '11.0' as default browser.
    '3/26/2014 2:15:42 PM' - 'Fail' : 1. Navigate to : '' - DataDriven: [$(testurl)]
    ------------------------------------------------------------
    Failure Information:
    ~~~~~~~~~~~~~~~
    Url passed in has invalid format. If you are trying to use relative paths, please make sure your url starts with '/' or '~/'.
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 31 Mar 2014 Link to this post

    Hello Stephen,

    1) Create yourself an XML file like this:
    <Navigate>
       <URL BaseURL="https://github.com" />
    </Navigate>

    2) Add the file as a data source
    3) Bind your Test Studio test to the data source
    4) Set your NavigateTo step to look like the attached screen shot



    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. Stephen
    Stephen avatar
    23 posts
    Member since:
    Feb 2014

    Posted 31 Mar 2014 Link to this post

    I tried setting the "/" in the NavigateURL (the binding is set up as described) but this still does not work.

    Do you have a working example of a "data driven" BaseURL or NavigateURL?

    Thanks,
    Steve

    Note: I logged this issue as a support ticket as well.
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 31 Mar 2014 Link to this post

    Hello Stephen,

    My last reply is a working example. Please tell me what "still does not work" means exactly. What do you actually get compared to what you expected to get? Let's focus on what your actual symptom/failure is.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!