This is a migrated thread and some comments may be shown as answers.

Parameterized Tests

3 Answers 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stephen
Top achievements
Rank 1
Stephen asked on 26 Mar 2014, 06:38 PM
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 '~/'.

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 31 Mar 2014, 05:38 PM
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
 
0
Stephen
Top achievements
Rank 1
answered on 31 Mar 2014, 08:26 PM
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.
0
Cody
Telerik team
answered on 31 Mar 2014, 09:44 PM
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
 
Tags
General Discussions
Asked by
Stephen
Top achievements
Rank 1
Answers by
Cody
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or