Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options, driver service, and timeout. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> to use.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout), ConvertOptionsToCapabilities(options))
 {
 }
Example #2
0
        private static ICommandExecutor CreateExecutor(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
        {
            ICommandExecutor executor = null;
            if (options.UseLegacyImplementation)
            {
                // Note: If BrowserExecutableLocation is null or empty, the legacy driver
                // will still do the right thing, and find Firefox in the default location.
                FirefoxBinary binary = new FirefoxBinary(options.BrowserExecutableLocation);

                FirefoxProfile profile = options.Profile;
                if (profile == null)
                {
                    profile = new FirefoxProfile();
                }

                executor = CreateExtensionConnection(binary, profile, commandTimeout);
            }
            else
            {
                if (service == null)
                {
                    throw new ArgumentNullException("service", "You requested a service-based implementation, but passed in a null service object.");
                }

                return new DriverServiceCommandExecutor(service, commandTimeout);
            }

            return executor;
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified driver service. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> used to initialize the driver.</param>
 public FirefoxDriver(FirefoxDriverService service)
     : this(service, new FirefoxOptions(), RemoteWebDriver.DefaultCommandTimeout)
 {
 }
Example #4
0
 private static FirefoxDriverService CreateService(FirefoxOptions options)
 {
     return(FirefoxDriverService.CreateDefaultService());
 }
 public NightlyChannelFirefoxDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options)
 {
 }
 public NightlyFirefoxWebDriver(FirefoxDriverService service)
     : this(service, DefaultOptions)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified path
 /// to the directory containing geckodriver.exe, options, and command timeout.
 /// </summary>
 /// <param name="geckoDriverDirectory">The full path to the directory containing geckodriver.exe.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public FirefoxDriver(string geckoDriverDirectory, FirefoxOptions options, TimeSpan commandTimeout)
     : this(FirefoxDriverService.CreateDefaultService(geckoDriverDirectory), options, commandTimeout)
 {
 }
Example #8
0
 public StableChannelFirefoxDriver(FirefoxDriverService service)
     : this(service, DefaultOptions)
 {
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options, driver service, and timeout. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> to use.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout), ConvertOptionsToCapabilities(options))
 {
     // Add the custom commands unique to Firefox
     this.AddCustomFirefoxCommands();
 }
Example #10
0
 public static FirefoxDriverService CreateDefaultService(string driverPath)
 {
     return(FirefoxDriverService.CreateDefaultService(driverPath, "wires.exe"));
 }
Example #11
0
 public StableChannelFirefoxDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
Example #12
0
        public static FirefoxDriverService CreateDefaultService()
        {
            string driverPath = DriverService.FindDriverServiceExecutable("wires.exe", FirefoxDriverService.FirefoxDriverDownloadUrl);

            return(FirefoxDriverService.CreateDefaultService(driverPath));
        }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options, driver service, and timeout. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> to use.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout), ConvertOptionsToCapabilities(options))
 {
     // Add the custom commands unique to Firefox
     this.CommandExecutor.CommandInfoRepository.TryAddCommand(SetContextCommand, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/moz/context"));
 }
 public NightlyChannelFirefoxDriver(FirefoxDriverService service)
     : this(service, DefaultOptions)
 {
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 public FirefoxDriver(FirefoxOptions options)
     : this(FirefoxDriverService.CreateDefaultService(), options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
Example #16
0
 public NightlyFirefoxWebDriver(FirefoxDriverService service)
     : base(service, new FirefoxOptions() { BrowserExecutableLocation = @"C:\Program Files (x86)\Nightly\firefox.exe" }, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
 public NightlyFirefoxWebDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options)
 {
 }
Example #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options, driver service, and timeout. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> to use.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout), options.ToCapabilities())
 {
 }
Example #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options, driver service, and timeout. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> to use.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
     : base(CreateExecutor(service, options, commandTimeout), ConvertOptionsToCapabilities(options))
 {
 }
 public ReleaseFirefoxWebDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
Example #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified options, driver service, and timeout. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> to use.</param>
 /// <param name="options">The <see cref="FirefoxOptions"/> to be used with the Firefox driver.</param>
 public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options)
     : this(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
 public ReleaseFirefoxWebDriver(FirefoxDriverService service)
     : this(service, DefaultOptions)
 {
 }
Example #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FirefoxDriver"/> class using the specified driver service. Uses the Mozilla-provided Marionette driver implementation.
 /// </summary>
 /// <param name="service">The <see cref="FirefoxDriverService"/> used to initialize the driver.</param>
 public FirefoxDriver(FirefoxDriverService service)
     : this(service, new FirefoxOptions(), RemoteWebDriver.DefaultCommandTimeout)
 {
 }
Example #24
0
 public ReleaseFirefoxWebDriver(FirefoxDriverService service)
     : base(service, new FirefoxOptions() { BrowserExecutableLocation = @"C:\Program Files\Mozilla Firefox\firefox.exe" }, RemoteWebDriver.DefaultCommandTimeout)
 {
 }