Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class WebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, IFinds
/// </summary>
protected static readonly TimeSpan DefaultCommandTimeout = TimeSpan.FromSeconds(60);
private IFileDetector fileDetector = new DefaultFileDetector();
private readonly NetworkManager network;
private NetworkManager network;
private WebElementFactory elementFactory;

private readonly List<string> registeredCommands = new List<string>();
Expand Down Expand Up @@ -73,7 +73,6 @@ protected WebDriver(ICommandExecutor executor, ICapabilities capabilities)
}

this.elementFactory = new WebElementFactory(this);
this.network = new NetworkManager(this);
this.registeredCommands.AddRange(DriverCommand.KnownCommands);

if (this is ISupportsLogs)
Expand Down Expand Up @@ -198,7 +197,7 @@ public virtual IFileDetector FileDetector
set => this.fileDetector = value ?? throw new ArgumentNullException(nameof(value), "FileDetector cannot be null");
}

internal INetwork Network => this.network;
internal INetwork Network => this.network ??= new NetworkManager(this);

/// <summary>
/// Gets or sets the factory object used to create instances of <see cref="WebElement"/>
Expand Down
Loading