Skip to content

Commit 0d878bd

Browse files
authored
Implementing ICommandExecutor's ExecuteAsync() and using it in Execute()
I think this *should* fix it in Selenium 4.22+, but its untested so far of course. :)
1 parent 1132ec7 commit 0d878bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using OpenQA.Selenium.Remote;
1616
using System;
17+
using System.Threading.Tasks;
1718

1819
namespace OpenQA.Selenium.Appium.Service
1920
{
@@ -54,13 +55,19 @@ internal AppiumCommandExecutor(AppiumLocalService service, TimeSpan timeForTheSe
5455
}
5556

5657
public Response Execute(Command commandToExecute)
58+
{
59+
return Task.Run(() => RealExecutor.ExecuteAsync(commandToExecute)).GetAwaiter().GetResult();
60+
}
61+
62+
public async Task<Response> ExecuteAsync(Command commandToExecute)
5763
{
5864
Response result = null;
5965

6066
try
6167
{
6268
bool newSession = HandleNewSessionCommand(commandToExecute);
63-
result = RealExecutor.Execute(commandToExecute);
69+
result = Task.Run(() => RealExecutor.ExecuteAsync(commandToExecute)).GetAwaiter().GetResult();
70+
6471
if (newSession)
6572
{
6673
RealExecutor = UpdateExecutor(result, RealExecutor);

0 commit comments

Comments
 (0)