Skip to content

Commit

Permalink
[dotnet] Return back protected synchronous Execute method in WebDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Jul 6, 2024
1 parent 425ed87 commit f096422
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/Remote/HttpCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public bool TryAddCommand(string commandName, CommandInfo info)
}

/// <summary>
/// Executes a command
/// Executes a command.
/// </summary>
/// <param name="commandToExecute">The command you wish to execute</param>
/// <returns>A response from the browser</returns>
/// <param name="commandToExecute">The command you wish to execute.</param>
/// <returns>A response from the browser.</returns>
public virtual Response Execute(Command commandToExecute)
{
return Task.Run(() => this.ExecuteAsync(commandToExecute)).GetAwaiter().GetResult();
Expand All @@ -165,8 +165,8 @@ public virtual Response Execute(Command commandToExecute)
/// <summary>
/// Executes a command as an asynchronous task.
/// </summary>
/// <param name="commandToExecute">The command you wish to execute</param>
/// <returns>A task object representing the asynchronous operation</returns>
/// <param name="commandToExecute">The command you wish to execute.</param>
/// <returns>A task object representing the asynchronous operation.</returns>
public virtual async Task<Response> ExecuteAsync(Command commandToExecute)
{
if (commandToExecute == null)
Expand Down
10 changes: 8 additions & 2 deletions dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,20 @@ internal Task<Response> InternalExecuteAsync(string driverCommandToExecute,
return this.ExecuteAsync(driverCommandToExecute, parameters);
}

internal Response Execute(string driverCommandToExecute,
/// <summary>
/// Executes a command with this driver.
/// </summary>
/// <param name="driverCommandToExecute">A <see cref="DriverCommand"/> value representing the command to execute.</param>
/// <param name="parameters">A <see cref="Dictionary{K, V}"/> containing the names and values of the parameters of the command.</param>
/// <returns>A <see cref="Response"/> containing information about the success or failure of the command and any data returned by the command.</returns>
protected virtual Response Execute(string driverCommandToExecute,
Dictionary<string, object> parameters)
{
return Task.Run(() => this.ExecuteAsync(driverCommandToExecute, parameters)).GetAwaiter().GetResult();
}

/// <summary>
/// Executes a command with this driver .
/// Executes a command with this driver.
/// </summary>
/// <param name="driverCommandToExecute">A <see cref="DriverCommand"/> value representing the command to execute.</param>
/// <param name="parameters">A <see cref="Dictionary{K, V}"/> containing the names and values of the parameters of the command.</param>
Expand Down

0 comments on commit f096422

Please sign in to comment.