OpenQA.Selenium.Remote.HttpCommandExecutor.HttpCommandExecutor C# (CSharp) Method

HttpCommandExecutor() public method

Initializes a new instance of the HttpCommandExecutor class
public HttpCommandExecutor ( Uri addressOfRemoteServer, System.TimeSpan timeout ) : System
addressOfRemoteServer System.Uri Address of the WebDriver Server
timeout System.TimeSpan The timeout within which the server must respond.
return System
        public HttpCommandExecutor(Uri addressOfRemoteServer, TimeSpan timeout)
        {
            if (addressOfRemoteServer == null)
            {
                throw new ArgumentNullException("addressOfRemoteServer", "You must specify a remote address to connect to");
            }

            if (!addressOfRemoteServer.AbsoluteUri.EndsWith("/", StringComparison.OrdinalIgnoreCase))
            {
                addressOfRemoteServer = new Uri(addressOfRemoteServer.ToString() + "/");
            }

            this.remoteServerUri = addressOfRemoteServer;
            this.serverResponseTimeout = timeout;

            // In the .NET Framework, HttpWebRequest responses with an error code are limited
            // to 64k by default. Since the remote server error responses include a screenshot,
            // they can frequently exceed this size. This only applies to the .NET Framework;
            // Mono does not implement the property.
            if (Type.GetType("Mono.Runtime", false, true) == null)
            {
                HttpWebRequest.DefaultMaximumErrorResponseLength = -1;
            }
        }