/// <summary> /// Initializes a new instance of the <see cref="SafariDriverServer"/> class using the specified options. /// </summary> /// <param name="options">The <see cref="SafariOptions"/> defining the browser settings.</param> public SafariDriverServer(SafariOptions options) { int webSocketPort = options.Port; if (webSocketPort == 0) { webSocketPort = PortUtilities.FindFreePort(); } this.webSocketServer = new WebSocketServer(webSocketPort, "ws://localhost/wd"); this.webSocketServer.Opened += new EventHandler <ConnectionEventArgs>(this.ServerOpenedEventHandler); this.webSocketServer.Closed += new EventHandler <ConnectionEventArgs>(this.ServerClosedEventHandler); this.webSocketServer.StandardHttpRequestReceived += new EventHandler <StandardHttpRequestReceivedEventArgs>(this.ServerStandardHttpRequestReceivedEventHandler); this.serverUri = new Uri(string.Format(CultureInfo.InvariantCulture, "http://localhost:{0}/", webSocketPort.ToString(CultureInfo.InvariantCulture))); if (string.IsNullOrEmpty(options.SafariLocation)) { this.safariExecutableLocation = GetDefaultSafariLocation(); } else { this.safariExecutableLocation = options.SafariLocation; } }
/// <summary> /// Initializes a new instance of the <see cref="SafariDriver"/> class using the specified <see cref="SafariOptions"/>. /// </summary> /// <param name="options">The <see cref="SafariOptions"/> to use for this <see cref="SafariDriver"/> instance.</param> public SafariDriver(SafariOptions options) : base(new SafariDriverCommandExecutor(options), options.ToCapabilities()) { }
/// <summary> /// Initializes a new instance of the <see cref="SafariDriverCommandExecutor"/> class. /// </summary> /// <param name="options">The <see cref="SafariOptions"/> used to create the command executor.</param> public SafariDriverCommandExecutor(SafariOptions options) { this.server = new SafariDriverServer(options); }