void InitializeSendCommand() { var commandInfo = new CommandInfo(CommandInfo.PostCommand, $"/session/{driver.SessionId}/chromium/send_command_and_get_result"); WebDriverCommandExecutor.TryAddCommand(driver, "sendCommand", commandInfo); }
private Response SendCommand(string cmd, object parameters = null) { var commandParams = new Dictionary <string, object> { { "cmd", cmd }, { "params", parameters ?? new object() } }; var response = WebDriverCommandExecutor.Execute(driver, "sendCommand", commandParams); if (response.Status != WebDriverResult.Success) { throw new ChromeRemoteInterfaceInvocationException(cmd, parameters, response); } return(response); }