private static WiniumDriverService CreateDefaultService(Type optionsType, string directory)
        {
            if (optionsType == typeof(DesktopOptions))
            {
                return(WiniumDriverService.CreateDesktopService(directory));
            }

            if (optionsType == typeof(StoreAppsOptions))
            {
                return(WiniumDriverService.CreateStoreAppsService(directory));
            }

            if (optionsType == typeof(SilverlightOptions))
            {
                return(WiniumDriverService.CreateSilverlightService(directory));
            }

            throw new ArgumentException(
                      "Option type must be type of DesktopOptions, StoreAppsOptions or SilverlightOptions",
                      "optionsType");
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WiniumDriver"/> class using the specified <see cref="WiniumDriverService"/>.
 /// </summary>
 /// <param name="service">The <see cref="WiniumDriverService"/> to use.</param>
 /// <param name="options">The <see cref="IWiniumOptions"/> object to be used with the Winium driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public WiniumDriver(WiniumDriverService service, IWiniumOptions options, TimeSpan commandTimeout)
     : base(new WiniumDriverCommandExecutor(service, commandTimeout), options.ToCapabilities())
 {
     this.InitWiniumDriverCommands();
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WiniumDriver"/> class using the specified 
 /// <see cref="WiniumDriverService"/> and options.
 /// </summary>
 /// <param name="service">The <see cref="WiniumDriverService"/> to use.</param>
 /// <param name="options">The <see cref="DesktopOptions"/> used to initialize the driver.</param>
 public WiniumDriver(WiniumDriverService service, IWiniumOptions options)
     : this(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
示例#4
0
 public WiniumDriverCommandExecutor(WiniumDriverService driverService, TimeSpan commandTimeout)
 {
     this.service          = driverService;
     this.internalExecutor = CommandExecutorFactory.GetHttpCommandExecutor(driverService.ServiceUrl, commandTimeout);
 }
 public WiniumDriverCommandExecutor(WiniumDriverService driverService, TimeSpan commandTimeout)
 {
     this.service = driverService;
     this.internalExecutor = CommandExecutorFactory.GetHttpCommandExecutor(driverService.ServiceUrl, commandTimeout);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WiniumDriver"/> class using the specified <see cref="WiniumDriverService"/>.
 /// </summary>
 /// <param name="service">The <see cref="WiniumDriverService"/> to use.</param>
 /// <param name="options">The <see cref="IWiniumOptions"/> object to be used with the Winium driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public WiniumDriver(WiniumDriverService service, IWiniumOptions options, TimeSpan commandTimeout)
     : base(new WiniumDriverCommandExecutor(service, commandTimeout), options.ToCapabilities())
 {
     this.InitWiniumDriverCommands();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WiniumDriver"/> class using the specified
 /// <see cref="WiniumDriverService"/> and options.
 /// </summary>
 /// <param name="service">The <see cref="WiniumDriverService"/> to use.</param>
 /// <param name="options">The <see cref="DesktopOptions"/> used to initialize the driver.</param>
 public WiniumDriver(WiniumDriverService service, IWiniumOptions options)
     : this(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }