/// <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)));
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SafariCommandMessage"/> class.
 /// </summary>
 /// <param name="command">The <see cref="SafariCommand"/> to wrap.</param>
 public SafariCommandMessage(SafariCommand command)
 {
     this.wrappedCommand = command;
 }