We are trying to do some automated UI testing using Selenium. So far for one function, we write at least 3 tests for IE, FF, Chrome.
For example, we wrote 3 tests: LoginTestFF, LoginTestIE, LoginTestChrome for the login function. This way, we can see 3 items in the VS Test View, and can select one or all of them to run.
Thanks to Selenium, the test code for each browser are pretty much same. So we don’t want to repeat that again.
Is it possible to see the tests in the VS Test View like:
LoginTestFF
LoginTestIE
LoginTestChrome
but using one set of test code?
I’ve found that the [Browser] attribute in xUnit should be OK.
How do develop such an attribute for Visual Studio Testing?
If you still want to see all three of them is VS test view, you may try this. (But what if you have ten different browsers?)
If you just want to reuse code for all browsers, you may define your desired browser in App.config, then use a switch case to select.