예제 #1
0
        /// <summary>
        /// Initializes a new instance of the PhantomJSDriver class using the specified <see cref="PhantomJSDriverService"/>.
        /// </summary>
        /// <param name="service">The <see cref="PhantomJSDriverService"/> to use.</param>
        /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
        /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
        public PhantomJSDriver(PhantomJSDriverService service, PhantomJSOptions options, TimeSpan commandTimeout)
            : base(new DriverServiceCommandExecutor(service, commandTimeout, false), options.ToCapabilities())
        {
            // Add the custom commandInfo of PhantomJSDriver
            CommandInfo commandInfo = new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/phantom/execute");

            CommandInfoRepository.Instance.TryAddCommand(CommandExecutePhantomScript, commandInfo);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhantomJSDriver"/> class with the desired options.
 /// </summary>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 public PhantomJSDriver(PhantomJSOptions options)
     : this(PhantomJSDriverService.CreateDefaultService(), options, TimeSpan.FromSeconds(60))
 {
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhantomJSDriver"/> class using the specified path
 /// to the directory containing PhantomJS.exe, options, and command timeout.
 /// </summary>
 /// <param name="phantomJSDriverServerDirectory">The full path to the directory containing PhantomJS.exe.</param>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public PhantomJSDriver(string phantomJSDriverServerDirectory, PhantomJSOptions options, TimeSpan commandTimeout)
     : this(PhantomJSDriverService.CreateDefaultService(phantomJSDriverServerDirectory), options, commandTimeout)
 {
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhantomJSDriver"/> class using the specified
 /// <see cref="PhantomJSDriverService"/> and options.
 /// </summary>
 /// <param name="service">The <see cref="PhantomJSDriverService"/> to use.</param>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 public PhantomJSDriver(PhantomJSDriverService service, PhantomJSOptions options)
     : this(service, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhantomJSDriver"/> class using the specified path
 /// to the directory containing PhantomJS.exe and options.
 /// </summary>
 /// <param name="phantomJSDriverServerDirectory">The full path to the directory containing PhantomJS.exe.</param>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 public PhantomJSDriver(string phantomJSDriverServerDirectory, PhantomJSOptions options)
     : this(phantomJSDriverServerDirectory, options, RemoteWebDriver.DefaultCommandTimeout)
 {
 }