Answer the question
In order to leave comments, you need to log in
C# How to open a new tab in WebDriver from an async method?
I'm running some tests with a website using C# + Selenium. I run 4 tests at the same time in asynchronous mode:
Task t1 = Task.Run(() => Check1());
Task t2 = Task.Run(() => Check2());
Task t3 = Task.Run(() => Check3());
Task t4 = Task.Run(() => Check3());
await Task.WhenAll(t1, t2, t3, t4);
IWebDriver Browser1;
ChromeDriverService service = ChromeDriverService.CreateDefaultService();
service.HideCommandPromptWindow = true;
ChromeOptions option = new ChromeOptions();
option.AddArgument("--headless");
Browser1 = new ChromeDriver(service, option);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question