I write UI automation tests using Selenium. And I noticed that when I create an instance of chromedriver.exe -> ~8 chrome.exe processes appear in the Task Manager.
Task Manager screenshot when running 1 test:
So, when I run in parallel, let's say, 8 tests there are a lot of chrome.exe instances in the Task Manager that use some ports and load a CPU and a memory.
Does it work by design? Why so much chrome.exe instances are needed for one chromedriver.exe? Is this configurable?
In my code, I just have a "Chrome" class. Its constructor creates a new chromedriver.exe instance:
Chrome chrome = new Chrome();
public class Chrome
{
public OpenQA.Selenium.Chrome.ChromeDriver Driver;
public Chrome(bool incognitoMode = false, bool maximizeWindow = true)
{
ChromeOptions options = new ChromeOptions();
if (incognitoMode)
{
options.AddArguments("--incognito");
}
Driver = new ChromeDriver(options);
Driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(360);
if (maximizeWindow)
Driver.Manage().Window.Maximize();
}
/////////////////////////////////////////////
}