Skip to content

Commit

Permalink
Get elements on UIThread iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth committed Oct 15, 2022
1 parent 809401b commit 4510236
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Agent/Apple/iOSApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public override async Task<string> GetProperty(string elementId, string property

public override Task<IEnumerable<IElement>> GetElements()
{
var root = GetRootElements(-1);
IEnumerable<IElement> root = Enumerable.Empty<IElement>();

UIApplication.SharedApplication.InvokeOnMainThread(() =>
{
root = GetRootElements(-1);
});

return Task.FromResult(root);
}
Expand Down

0 comments on commit 4510236

Please sign in to comment.