CreateDriverInstance() private method

Creates an instance of an IWebDriver most closely matching the specified capabilities.
private CreateDriverInstance ( ICapabilities capabilities ) : IWebDriver
capabilities ICapabilities An object describing the desired capabilities for the driver to be created.
return IWebDriver
Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DriverSession"/> class.
 /// </summary>
 /// <param name="factory">The <see cref="DriverFactory"/> responsible for creating the <see cref="IWebDriver"/> for the session.</param>
 /// <param name="capabilities">The capabilities of the driver of the session.</param>
 internal DriverSession(DriverFactory factory, ICapabilities capabilities)
 {
     this.sessionDriver = factory.CreateDriverInstance(capabilities);
     DesiredCapabilities actualSessionCapabilities = new DesiredCapabilities(capabilities.BrowserName, capabilities.Version, Platform.CurrentPlatform);
     actualSessionCapabilities.IsJavaScriptEnabled = true;
     this.sessionCapabilities = actualSessionCapabilities;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DriverSession"/> class.
        /// </summary>
        /// <param name="factory">The <see cref="DriverFactory"/> responsible for creating the <see cref="IWebDriver"/> for the session.</param>
        /// <param name="capabilities">The capabilities of the driver of the session.</param>
        internal DriverSession(DriverFactory factory, ICapabilities capabilities)
        {
            this.sessionDriver = factory.CreateDriverInstance(capabilities);
            DesiredCapabilities actualSessionCapabilities = new DesiredCapabilities(capabilities.BrowserName, capabilities.Version, Platform.CurrentPlatform);

            actualSessionCapabilities.IsJavaScriptEnabled = true;
            this.sessionCapabilities = actualSessionCapabilities;
        }