This question is locked. New answers and comments are not allowed.
Martin Blair
Top achievements
Rank 1
Martin Blair
asked on 20 Nov 2009, 10:07 PM
I am wondering which is the best way to pass parameters to your webaii tests. I need to be able to run my tests against several different builds, each which uses there own web server/url. Can you guys advise me on the best way to do that?
When I run a web test from the beta I notice that the command line there is a mention of a BaseURL. I realize that this is a beta feature but is there any documentation? This is a problem I need to solve sooner than later and I am hoping to solve this with the latest version.
So the use case is as follows:
I run several different TFS builds and they end up on different web servers depending on the purpose of the build. How can I specify a 'BaseURL' for my suite of tests to run against that varys depending which build is currently running? I would just use an environment variable or something but in at least one case, there is more than one build happening on a box. What could I put in a build script to set and pass this information? How would I reflect it within a test or test step?
When I run a web test from the beta I notice that the command line there is a mention of a BaseURL. I realize that this is a beta feature but is there any documentation? This is a problem I need to solve sooner than later and I am hoping to solve this with the latest version.
So the use case is as follows:
I run several different TFS builds and they end up on different web servers depending on the purpose of the build. How can I specify a 'BaseURL' for my suite of tests to run against that varys depending which build is currently running? I would just use an environment variable or something but in at least one case, there is more than one build happening on a box. What could I put in a build script to set and pass this information? How would I reflect it within a test or test step?
13 Answers, 1 is accepted
0
Hi Martin,
Thanks for trying out the beta. From your description, it seems base url would partially work for the scenario. Just to make sure though, I am assuming your URLs look like: http://InternalServer/Testing/BuildVersion
If this is the case, you can have the base URL as: http://InternalServer/Testing
In the user settings, described in this video, you can set the base url for the test project level for Quick Execution Mode. You can set the base url for Visual Studio execution in the .testrunconfig file. And you can set the base url on a test step level in the properties window for a navigation test step.
For the rest of the URL that will end up varying, you can either create copies of the basic test for each build version and change the navigation step manually. Or you can convert the navigation steps to code and write a script that passes in a variable to the navigation code.
The test runner is actually the newer feature, and may not display the base url correctly even though the test uses the base url properly This has been logged as a possible bug, so please let us know if you see this in using the feature.
We would also appreciate any other feedback you may have on any other WebUI features.
Sincerely yours,
Nelson Sin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks for trying out the beta. From your description, it seems base url would partially work for the scenario. Just to make sure though, I am assuming your URLs look like: http://InternalServer/Testing/BuildVersion
If this is the case, you can have the base URL as: http://InternalServer/Testing
In the user settings, described in this video, you can set the base url for the test project level for Quick Execution Mode. You can set the base url for Visual Studio execution in the .testrunconfig file. And you can set the base url on a test step level in the properties window for a navigation test step.
For the rest of the URL that will end up varying, you can either create copies of the basic test for each build version and change the navigation step manually. Or you can convert the navigation steps to code and write a script that passes in a variable to the navigation code.
The test runner is actually the newer feature, and may not display the base url correctly even though the test uses the base url properly This has been logged as a possible bug, so please let us know if you see this in using the feature.
We would also appreciate any other feedback you may have on any other WebUI features.
Sincerely yours,
Nelson Sin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Martin Blair
Top achievements
Rank 1
answered on 23 Nov 2009, 04:51 PM
I think this will work nicely,
So I have set my baseURL for my quick runs, my localrun.config, and the various build configs. My question now is how do I implement that? Do I alter the navigation urls in the scripts with some sort of variable like $ (BaseURL) ?
So I have set my baseURL for my quick runs, my localrun.config, and the various build configs. My question now is how do I implement that? Do I alter the navigation urls in the scripts with some sort of variable like $ (BaseURL) ?
0
Hello again Martin,
From what I understand of the scenario, if you create a script to pass in a variable build url, the navigation steps converted to code may look like this:
So the navigation would combine the BaseURL + buildURLVar to navigate to the page you wanted in your various builds.
Best wishes,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
From what I understand of the scenario, if you create a script to pass in a variable build url, the navigation steps converted to code may look like this:
[CodedStep(@"Navigate to : Relative build URL")] public void WebAiiTest1_CodedStep() { ActiveBrowser.NavigateTo(buildURLVar); // URL format like "~/BuildURL/Page.html" }So the navigation would combine the BaseURL + buildURLVar to navigate to the page you wanted in your various builds.
Best wishes,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Martin Blair
Top achievements
Rank 1
answered on 23 Nov 2009, 07:16 PM
I don't need a script to pass the URL do I? All I need is to know how to referrence the BaseURL that I set in the configs and settings.
Having that I could :
What do I need to do in order to referrence baseURL in my codestep?
Do I even need a codestep? Could I place the variable within a navigation step url using escape characters or something?
Having that I could :
| { |
| ActiveBrowser.NavigateTo(baseURL+WhateverSubAddress); |
| } |
What do I need to do in order to referrence baseURL in my codestep?
Do I even need a codestep? Could I place the variable within a navigation step url using escape characters or something?
0
Hello again Martin,
Sorry about that, I got the impression you were going to pass in a variable using a script. So in the navigation steps, all you would need is to change the NavigateUrl property to "~/WhateverSubAddress" and that should put the complete URL together for you.
Kind regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Sorry about that, I got the impression you were going to pass in a variable using a script. So in the navigation steps, all you would need is to change the NavigateUrl property to "~/WhateverSubAddress" and that should put the complete URL together for you.
Kind regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Martin Blair
Top achievements
Rank 1
answered on 23 Nov 2009, 08:01 PM
So I have a baseURL for the quickrun setting under the recorder but it doesn't seem to be taking it. I had to play with it for a while for the setting to persist but when I return to that settings screen it persists. See screenshot : Blank_URL.jpg
And just to make sure I understand you, can you check the other attached screenshot of a navigate step properties to see if I have it set correctly?
I know all of this is beta but I really need to get this working before we can consider purchasing a license. Thanks
And just to make sure I understand you, can you check the other attached screenshot of a navigate step properties to see if I have it set correctly?
I know all of this is beta but I really need to get this working before we can consider purchasing a license. Thanks
0
Hello again Martin,
Looks like the '~' is no longer necessary in the NavigateURL step properties. So the following:
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Looks like the '~' is no longer necessary in the NavigateURL step properties. So the following:
BaseUrl: http://news.google.com
NavigateURL: /news/section?pz=1&cf=all&ned=us&topic=w&ict=ln
should navigate to google news. In the test runner, the blank base url will unfortunately still be blank even though the test navigates sucessfully.
Regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Martin Blair
Top achievements
Rank 1
answered on 23 Nov 2009, 08:46 PM
Ahh I see!,
I created a new test project. This seems to have solved the problem and the baseURL is incorporated automatically. As long as I set the baseURL before I started writing tests for the project it automatically took out the base url from my navigation steps.
And as you said, it looks like the "~" is not needed.
Also, as you said, the test runner shows blank for the base url but it used it regardless.
If I can do some tests and see if it uses the baseURL from different specified .runconfigs I'll be all ready :)
Thanks for the help so far!
I created a new test project. This seems to have solved the problem and the baseURL is incorporated automatically. As long as I set the baseURL before I started writing tests for the project it automatically took out the base url from my navigation steps.
And as you said, it looks like the "~" is not needed.
Also, as you said, the test runner shows blank for the base url but it used it regardless.
If I can do some tests and see if it uses the baseURL from different specified .runconfigs I'll be all ready :)
Thanks for the help so far!
0
Hello again Martin,
I'm glad to hear you got it working. I'll check out why adding a new project would be necessary to get this working. Please feel free to create new threads if you run into any other issues or have further feedback.
Greetings,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I'm glad to hear you got it working. I'll check out why adding a new project would be necessary to get this working. Please feel free to create new threads if you run into any other issues or have further feedback.
Greetings,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Joanne Norvell
Top achievements
Rank 1
answered on 12 Jan 2010, 09:19 PM
Hi Nelson:
I have the same issue as described in this thread.
YES! Updating the BaseURL property IN EACH SCRIPT works just fine. I would need to update EACH script every time the BaseUrl changes (like moving code to a different server IP) - which is what I'd like to avoid (well, an update of the 150 scripts will be needed to implement the solution we identify...My goal is to do this update once!).
Here's what I did:
I have the same issue as described in this thread.
YES! Updating the BaseURL property IN EACH SCRIPT works just fine. I would need to update EACH script every time the BaseUrl changes (like moving code to a different server IP) - which is what I'd like to avoid (well, an update of the 150 scripts will be needed to implement the solution we identify...My goal is to do this update once!).
Here's what I did:
- I set the BaseUrl property in the LocalTestRun.testrunconfig file, then built the solution.
- I removed the BaseUrl property in the login script and re-ran it. Note the script runs fine with the BaseUrl property in the scriptN
- No BaseUrl was provided to the script during execution from the LocalTestRun.testrunconfig, so the script failed.
Is there something I'm not doing? You mentioned passing a variable into the script. Do you have a code sample or know of a site where I can obtain a code sample?
I appreciate your help.
Regards,
JoNo
0
Martin Blair
Top achievements
Rank 1
answered on 12 Jan 2010, 10:10 PM
I just created different .config files for each url I want to run the tests against and set different BaseURLs for each one.
LocalTestRun.config
DailyBuild.config
StageDeployment.config
You can explicity specify which config to use when running tests
LocalTestRun.config
DailyBuild.config
StageDeployment.config
You can explicity specify which config to use when running tests
0
Hi,
Thanks for the post Martin, that would be useful when running against multiple base urls.
Based on your screenshot Joanne, please set the base url in the user settings. Any test that you run from the project in quick execution mode should then use that base url.
Kind regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks for the post Martin, that would be useful when running against multiple base urls.
Based on your screenshot Joanne, please set the base url in the user settings. Any test that you run from the project in quick execution mode should then use that base url.
Kind regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Hi again,
I rechecked baseurl in the user settings for a quick execution run, and it looks like trying to unset (ie blank it out) is not working, even after a save/close solution.
Using another new base url in the user settings will work and the new baseurl will be populated.
I'll log a bug for this, and sorry about the late reply.
Greetings,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I rechecked baseurl in the user settings for a quick execution run, and it looks like trying to unset (ie blank it out) is not working, even after a save/close solution.
Using another new base url in the user settings will work and the new baseurl will be populated.
I'll log a bug for this, and sorry about the late reply.
Greetings,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.