예제 #1
0
 private static FirefoxDriverServiceEx CreateService(FirefoxDriverServiceEx options)
 {
     if ((options != null) && options.UseLegacyImplementation)
     {
         return null;
     }
     return FirefoxDriverServiceEx.CreateDefaultService();
 }
예제 #2
0
 private static ICapabilities ConvertOptionsToCapabilities(FirefoxDriverServiceEx options)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options", "options must not be null");
     }
     ICapabilities capabilities = options.ToCapabilities();
     if (options.UseLegacyImplementation)
     {
         capabilities = RemoveUnneededCapabilities(capabilities);
     }
     return capabilities;
 }
예제 #3
0
 private static FirefoxDriverServiceEx CreateOptionsFromCapabilities(ICapabilities capabilities)
 {
     FirefoxBinary binary = ExtractBinary(capabilities);
     DesiredCapabilities capabilities2 = RemoveUnneededCapabilities(capabilities) as DesiredCapabilities;
     FirefoxDriverServiceEx options = new FirefoxDriverServiceEx(ExtractProfile(capabilities), binary);
     if (capabilities2 != null)
     {
         foreach (KeyValuePair<string, object> pair in capabilities2.ToDictionary())
         {
             options.AddAdditionalCapability(pair.Key, pair.Value);
         }
     }
     return options;
 }
예제 #4
0
 private static ICommandExecutor CreateExecutor(FirefoxDriverServiceEx service, FirefoxDriverServiceEx options, TimeSpan commandTimeout)
 {
     if (options.UseLegacyImplementation)
     {
         FirefoxProfile profile = options.Profile;
         if (profile == null)
         {
             profile = new FirefoxProfile();
         }
         return CreateExtensionConnection(new FirefoxBinary(options.BrowserExecutableLocation), profile, commandTimeout);
     }
     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);
 }
예제 #5
0
 public FirefoxDriverEx(string geckoDriverDirectory, FirefoxDriverServiceEx options, TimeSpan commandTimeout) : this(FirefoxDriverServiceEx.CreateDefaultService(geckoDriverDirectory), options, commandTimeout)
 {
 }
예제 #6
0
 public FirefoxDriverEx(FirefoxDriverServiceEx service, FirefoxDriverServiceEx options, TimeSpan commandTimeout) : base(CreateExecutor(service, options, commandTimeout), ConvertOptionsToCapabilities(options))
 {
 }
예제 #7
0
 public FirefoxDriverEx(string geckoDriverDirectory, FirefoxDriverServiceEx options) : this(geckoDriverDirectory, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
예제 #8
0
 public FirefoxDriverEx(FirefoxDriverServiceEx options) : this(CreateService(options), options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
예제 #9
0
 public FirefoxDriverEx(FirefoxDriverServiceEx service) : this(service, new FirefoxDriverServiceEx(), RemoteWebDriver.DefaultCommandTimeout)
 {
 }