diff --git a/WebDriverAgentLib/Routing/FBSession.m b/WebDriverAgentLib/Routing/FBSession.m index 14565ad00..1faafd3af 100644 --- a/WebDriverAgentLib/Routing/FBSession.m +++ b/WebDriverAgentLib/Routing/FBSession.m @@ -179,7 +179,8 @@ - (XCUIApplication *)activeApplication XCUIApplicationState testedAppState = self.testedApplication.state; if (testedAppState >= XCUIApplicationStateRunningForeground) { if ([FBConfiguration shouldRespectSystemAlerts] - && [XCUIApplication.fb_systemApplication descendantsMatchingType:XCUIElementTypeAlert].count > 0) { + && ([XCUIApplication.fb_systemApplication descendantsMatchingType:XCUIElementTypeAlert].count > 0 + || [XCUIApplication.fb_systemApplication fb_descendantsMatchingProperty:@"name" value:@"SBTransientOverlayWindow" partialSearch:false].count > 0)) { return XCUIApplication.fb_systemApplication; } return (XCUIApplication *)self.testedApplication;