I've created the simplest-possible NUnit test to initialise a ChromeDriver, and it's taking nearly 6 seconds to run. Most of the time (roughly 4s) is spent with a blank, inactive Chrome window.

The ChromeDriver.exe window appears almost instantly.

My unit test looks like this:
[Test]
public void Simplest_Possible_Test()
{
var options = new ChromeOptions { Proxy = null };
using (new ChromeDriver(options))
{
// Do nothing
}
}
and I'm using these nuget packages:
<package id="NUnit" version="3.12.0" targetFramework="net47" />
<package id="Selenium.Support" version="3.141.0" targetFramework="net47" />
<package id="Selenium.WebDriver" version="3.141.0" targetFramework="net47" />
<package id="Selenium.WebDriver.ChromeDriver" version="78.0.3904.7000" targetFramework="net47" />
My question is:
Is this slowness expected? Can I do anything to speed it up?
I am using following singleton IWebDriver instance and it only takes couple of seconds to launch.
public class UiTest : IDisposable
{
private IWebDriver driver = null;
protected IWebDriver Driver
{
get
{
if (driver == null)
{
driver = new ChromeDriver(new ChromeOptions{Proxy = null});
driver.Manage().Window.Maximize();
}
return _driver;
}
}
public void Dispose()
{
driver?.Dispose();
}
}
In windows Automatic proxy setup, you can turn off "Automatic detect settings" and see if there is any difference. However, passing null proxy for ChromeOptions has the similar effect, I guess.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With