我使用NUnit3的Parallelizable屬性來運行我的Selenium WebDriver測試,但測試始終是按順序運行的。我的機器的默認工人數爲4。我有一個像下面2個夾具:與NUnit3並行運行Selenium WebDriver測試
[TestFixture]
[Parallelizable(ParallelScope.Fixtures)]
public class SeleniumTest1
{
[Test]
public void Is_Title_Correct()
{
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.google.nl");
string actualTitle = driver.Title;
string expectedTitle = "Google";
Assert.AreEqual(expectedTitle, actualTitle, "title is not correct");
driver.Quit();
}
}
我怎樣才能得到它並行運行,以便它可以同時打開兩個瀏覽器?
你有另一個TextFixtures,或者你只顯示了1下的所有測試嗎? –
我有彼此測試夾具:'[的TestFixture] [可並行(ParallelScope.Fixtures)] 公共類SeleniumTest2 { [測試] 公共無效Is_Title_Correct() { IWebDriver驅動=新FirefoxDriver(); driver.Navigate()。GoToUrl(「http://www.google.nl」); string actualTitle = driver.Title; string expectedTitle =「Google」; Assert.AreEqual(expectedTitle,actualTitle,「標題不正確」); driver.Quit(); } }' – Megha
您是否嘗試過將這兩種不同的TestFixture一起運行? –