예제 #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))
 {
 }
예제 #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;
        }
예제 #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)
 {
 }
예제 #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)
 {
 }
예제 #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)
 {
 }
예제 #8
0
 public StableChannelFirefoxDriver(FirefoxDriverService service)
     : this(service, DefaultOptions)
 {
 }
예제 #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();
 }
예제 #10
0
 public static FirefoxDriverService CreateDefaultService(string driverPath)
 {
     return(FirefoxDriverService.CreateDefaultService(driverPath, "wires.exe"));
 }
예제 #11
0
 public StableChannelFirefoxDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
예제 #12
0
        public static FirefoxDriverService CreateDefaultService()
        {
            string driverPath = DriverService.FindDriverServiceExecutable("wires.exe", FirefoxDriverService.FirefoxDriverDownloadUrl);

            return(FirefoxDriverService.CreateDefaultService(driverPath));
        }
예제 #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)
 {
 }
예제 #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)
 {
 }
예제 #16
0
 public NightlyFirefoxWebDriver(FirefoxDriverService service)
     : base(service, new FirefoxOptions() { BrowserExecutableLocation = @"C:\Program Files (x86)\Nightly\firefox.exe" }, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
예제 #17
0
 public NightlyFirefoxWebDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options)
 {
 }
예제 #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())
 {
 }
예제 #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))
 {
 }
예제 #20
0
 public ReleaseFirefoxWebDriver(FirefoxDriverService service, FirefoxOptions options)
     : base(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
예제 #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)
 {
 }
예제 #22
0
 public ReleaseFirefoxWebDriver(FirefoxDriverService service)
     : this(service, DefaultOptions)
 {
 }
예제 #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)
 {
 }
예제 #24
0
 public ReleaseFirefoxWebDriver(FirefoxDriverService service)
     : base(service, new FirefoxOptions() { BrowserExecutableLocation = @"C:\Program Files\Mozilla Firefox\firefox.exe" }, RemoteWebDriver.DefaultCommandTimeout)
 {
 }