protected Execute ( |
||
driverCommandToExecute | A |
|
parameters | object>.Dictionary | A |
리턴 | OpenQA.Selenium.Remote.Response |
protected virtual Response Execute(DriverCommand driverCommandToExecute, Dictionary<string, object> parameters)
{
Command commandToExecute = new Command(this.sessionId, driverCommandToExecute, parameters);
Response commandResponse = new Response();
try
{
commandResponse = this.executor.Execute(commandToExecute);
}
catch (System.Net.WebException e)
{
commandResponse.Status = WebDriverResult.UnhandledError;
commandResponse.Value = e;
}
if (commandResponse.Status != WebDriverResult.Success)
{
UnpackAndThrowOnError(commandResponse);
}
return commandResponse;
}
/// <summary> /// Method for creating a cookie in the browser /// </summary> /// <param name="cookie"><see cref="Cookie"/> that represents a cookie in the browser</param> public void AddCookie(Cookie cookie) { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("cookie", cookie); driver.Execute(DriverCommand.AddCookie, parameters); }