diff --git a/src/Appium.Net/Appium.Net.csproj b/src/Appium.Net/Appium.Net.csproj index 50729e93..220b7aa9 100644 --- a/src/Appium.Net/Appium.Net.csproj +++ b/src/Appium.Net/Appium.Net.csproj @@ -58,8 +58,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs b/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs index e06a3374..0e0f7a94 100644 --- a/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs +++ b/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs @@ -14,6 +14,7 @@ using OpenQA.Selenium.Remote; using System; +using System.Threading.Tasks; namespace OpenQA.Selenium.Appium.Service { @@ -54,13 +55,18 @@ internal AppiumCommandExecutor(AppiumLocalService service, TimeSpan timeForTheSe } public Response Execute(Command commandToExecute) + { + return Task.Run(() => ExecuteAsync(commandToExecute)).GetAwaiter().GetResult(); + } + + public async Task ExecuteAsync(Command commandToExecute) { Response result = null; try { bool newSession = HandleNewSessionCommand(commandToExecute); - result = RealExecutor.Execute(commandToExecute); + result = await RealExecutor.ExecuteAsync(commandToExecute).ConfigureAwait(false); if (newSession) { RealExecutor = UpdateExecutor(result, RealExecutor);