From 9345efc134bcb786363592296d08289d60c54b60 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Tue, 6 Aug 2024 11:18:14 +0200 Subject: [PATCH] fix: Wait for the browser to load before continuing the session --- WebDriverAgentLib/Commands/FBSessionCommands.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WebDriverAgentLib/Commands/FBSessionCommands.m b/WebDriverAgentLib/Commands/FBSessionCommands.m index 97baab7a1..666ff9312 100644 --- a/WebDriverAgentLib/Commands/FBSessionCommands.m +++ b/WebDriverAgentLib/Commands/FBSessionCommands.m @@ -188,6 +188,10 @@ + (NSArray *)routes if (nil != errorResponse) { NSLog(@"Was not able to open the default URL %@ in Safari", healthEndpoint); } + NSLog(@"Waiting for %@ to finish loading", healthEndpoint); + // To avoid the race condition while starting the remote debugger + [app fb_waitUntilStableWithTimeout:15.0]; + NSLog(@"Load completed: %@", healthEndpoint); } } if (!app.running) {