Essentially I have 1 test that I want to run on multiple threads at the same time. Currently the only was I have found to do it is to rewrite the test for every thread I want to run so if I want it 10 run 10 times in parallel I have to write 10 tests.
I'm trying to do some minor load testing on a website by using selenium and C# to open multiple instances and attempt to fill in a form. I'm also trying to test race conditions for when the sign-ups are full
[TestFixture]
[Parallelizable]
class TournamentPageScript1
{
public static IWebDriver driver = new ChromeDriver();
public static IWebDriver getDriverInstance()
{
return driver;
}
[SetUp]
public void initialize()
{
driver.Navigate().GoToUrl("https://mywebsite.com");
}
[Test]
public void validateTournamentPage001()
{
//do some stuff
}
[TearDown]
public void tearDown()
{
driver.Close();
}
}
[TestFixture]
[Parallelizable]
class TournamentPageScript2
{
public static IWebDriver driver = new ChromeDriver();
public static IWebDriver getDriverInstance()
{
return driver;
}
[SetUp]
public void initialize()
{
driver.Navigate().GoToUrl("https://mywebsite.com");
}
[Test]
public void validateTournamentPage002()
{
//do some stuff
}
[TearDown]
public void tearDown()
{
driver.Close();
}
}
I want to only have to write the test 1 time and have the Selenium repeat the test in parallel over multiple threads.