/// <summary> /// Sends a command to the SafariDriver and waits for a response. /// </summary> /// <param name="command">The <see cref="Command"/> to send to the driver.</param> /// <returns>The <see cref="Response"/> from the command.</returns> public Response Send(Command command) { SafariCommand wrappedCommand = new SafariCommand(command); this.commandQueue.Enqueue(wrappedCommand); SafariCommandMessage wrapper = new SafariCommandMessage(wrappedCommand); string commandJson = JsonConvert.SerializeObject(wrapper); this.connection.Send(commandJson); return this.WaitForResponse(TimeSpan.FromSeconds(30)); }
/// <summary> /// Sends a command to the SafariDriver and waits for a response. /// </summary> /// <param name="command">The <see cref="Command"/> to send to the driver.</param> /// <returns>The <see cref="Response"/> from the command.</returns> public Response Send(Command command) { SafariCommand wrappedCommand = new SafariCommand(command); this.commandQueue.Enqueue(wrappedCommand); SafariCommandMessage wrapper = new SafariCommandMessage(wrappedCommand); string commandJson = JsonConvert.SerializeObject(wrapper); this.connection.Send(commandJson); return(this.WaitForResponse(TimeSpan.FromSeconds(30))); }