I am newer in NUnit and try to parallel testing. When I run these two tests, both will start, but only one is going to driver.Url and second do nothing after opened browser. After few seconds both test will crash. Individually both test works and I have 4cores CPU. So where can be a problem? Here is my code:
[TestFixture]
[Parallelizable]
public class TestimonialTests : Base
{
[Test]
public void VerifyTestimonialCount()
{
DataCollection.driver.Url = "http://google.com";
System.Threading.Thread.Sleep(10000);
}
}
[TestFixture]
[Parallelizable]
public class TestClass : Base
{
[Test]
public void TestMethod()
{
DataCollection.driver.Url = "http://google.com";
System.Threading.Thread.Sleep(10000);
}
}
public class Base
{
[SetUp]
public void BeforeAll()
{
DataCollection.driver = new ChromeDriver();
DataCollection.driver.Manage().Window.Maximize();
DataCollection.driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20));
}
[TearDown]
public void AfterAll()
{
DataCollection.driver.Quit();
}
}
Aucun commentaire:
Enregistrer un commentaire