OpenQA.Selenium.Remote.RemoteWebDriver.Manage C# (CSharp) Method

Manage() public method

Method For getting an object to set the Speen
public Manage ( ) : IOptions
return IOptions
        public IOptions Manage()
        {
            return new RemoteOptions(this);
        }

Usage Example

Exemplo n.º 1
1
        public static IWebDriver CreateChromeGridDriver(string profileName, string hubAddress)
        {
            if (hubAddress == null)
            {
                throw new ArgumentException("remoteAddress");
            }

            var chromeOptions = new ChromeOptions();
            if (!string.IsNullOrWhiteSpace(profileName))
            {
                var fileChars = Path.GetInvalidFileNameChars();
                var pathChars = Path.GetInvalidFileNameChars();
                var invalidChars = fileChars.Union(pathChars);

                profileName = String.Join("", profileName.Where(c => !invalidChars.Contains(c)));

                chromeOptions.AddArguments(String.Format("user-data-dir=c:\\ChromeProfiles\\{0}", profileName));
            }

            RemoteWebDriver Driver = new RemoteWebDriver(new Uri(hubAddress), chromeOptions.ToCapabilities());

            Driver.Manage().Timeouts().SetPageLoadTimeout(new TimeSpan(0, 1, 0));
            Driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 1));
            Driver.Manage().Window.Maximize();
            return Driver;
        }
All Usage Examples Of OpenQA.Selenium.Remote.RemoteWebDriver::Manage