At the moment my tests are running only in Firefox, because that is the driver which initialize at last. I need to run my tests on both Firefox and Chrome. Parallel or serially. But it should be automatic.
Below is my example test-code:.
namespace TestOne
{
[TestClass]
public class UnitTest1
{
public static IWebDriver driver;
[TestInitialize]
public void BeforeEveryTest()
{
driver = new ChromeDriver();
driver = new FirefoxDriver();
}
[TestMethod]
public void NavigateToGoogle()
{
driver.Navigate().GoToUrl("http://google.com");
}
[TestCleanup]
public void RunAfterEveryTest()
{
driver.Quit();
}
}
}
What are the options to run this test for both Chrome and Firefox? When using the C# testing tools (e.g. mstest.exe or vstest.console.exe)