giovedì 14 giugno 2012 07:55
As part of test automation, I have to run tests mutiple times on different browsers. For each run tests would be running on a difefrent browser. App.config has the configuration about which browser has to use for test run. If I have to run my tests on IE, Firefox and Chrome, I want to have app.config.ie, app.config.firefox and app.config.chrome.
As I am going to have 3 (or more) different config files, can I have those number of build definitions which will run the tests by picking the specific app.config.[browser]. And I don't want to build the application in each build definition. All build definitions should work on a common build.
Can any body suggest me on this?
Tutte le risposte
giovedì 14 giugno 2012 23:23
Your question is a bit unclear to me; Do you have a multiple copies of your application running, and then depending which browser is detected a different application redirects the user to the version configured for their browser type?
You want some build definitions that just test the binary, but do not build the application. But what kind of tests? Are they Unit Tests or CodedUI tests? Can we assume that the build is already deployed to IIS somewhere?
Are you using Lab Management?
It may be helpful for you to look at 2 things that can help you regardless:
Running MSTEST on the command line. You could write a script that checks the config file and runs MSTest as appropriate on an existing build: http://msdn.microsoft.com/en-us/library/ms182490(v=vs.110).aspx. You can even schedule such a script to run regularly using Windows.
The Run Tests Section and MSTest activity in the Build Process Template. Look for the section in the build workflow named Run Tests. You can modify this section to customize the build so that it runs the tests once for each configuration you have if that makes sense:
venerdì 15 giugno 2012 14:12
Thanks for responding.
Tests are Nunit tests.
I need multiple definitions with different app.config files. Each build definition would be running the tests on a different browser. Yes each build definition would be starting new instance of the application but with a different briowser.
lunedì 18 giugno 2012 09:16Moderatore
Thanks for your feedback!
I am currently looking into this issue and will give you an update as soon as possible.
Thank you for your understanding and support.
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us
lunedì 18 giugno 2012 14:50Hi. I am looking into a similar issue, where we use different versions of the app.config file to create builds for multiple environments, and I want to automate these multi-builds in TFS Build. I've been modifying the process template and building custom activities for this purpose, but it's just so much more complex than it should be.
lunedì 18 giugno 2012 22:08
In TFS build, Project to build can pick up your solution file. Automated tests can pick up your test list. If you can create different test lists such as IE, Firefox or Chrome, you can only use 1 build definition to cover all browsers testing in TFS build.
Otherwise, I think TFS source control need to have 3 locations for IE, Chrome and Firefox. At that time, you can use multiple build definitions.
- Contrassegnato come risposta Cathy KongMicrosoft Contingent Staff, Moderator venerdì 22 giugno 2012 01:48
lunedì 2 luglio 2012 08:54
Thanks for your reply. But I think I have not understood it completely.
As you said, I am able to see 'Automated Tests'. But there how to specify different test lists and how to make sure each test list picking a different config file.