/// <summary>
/// Starts the connection to the browser extension.
/// </summary>
public void Start()
{
int retries = MaxStartRetries;
while (retries > 0 && !HasClient)
{
Stop();
try
{
StartListening();
executorBinary.Start();
}
catch (IOException e)
{
throw new WebDriverException("Could not start client", e);
}
if (!HasClient)
{
// In case this attempt fails, we increment how long we wait before sending a command
ChromeBinary.IncrementStartWaitInterval(1);
}
retries--;
}
// The last one attempt succeeded, so we reduce back to that time
// chromeBinary.IncrementBackoffBy(-1);
if (!HasClient)
{
Stop();
throw new FatalChromeException("Cannot create chrome driver");
}
}