appium / dotnet-client

Extension to the official Selenium dotnet webdriver
Apache License 2.0
381 stars 186 forks source link

iOSDriver not returning all the available contexts in Appium 5.0.0-rc.2 #801

Closed openboxmn closed 2 weeks ago

openboxmn commented 3 months ago

Description

When switching from Native view to WebView, calling Driver.Contexts.ToList() returns only the current context. But when you call the method second time, all the contexts are returned.

Environment

.Net Framework 4.7.2 Node version v19.6.0

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

var AppiumDriver = new IOSDriver(TargetUri, AppiumCapabilities); var context = AppiumDriver.Contexts.ToList(); Actual Result: context has only the Native_App Expected Result: context should have all the available views.

KazuCocoa commented 3 months ago

Could you share the appium server log?

It is potentially expected to collect WebView contexts on iOS. It could take time in the first time. Increasing appium:webviewConnectTimeout in capabilities https://appium.github.io/appium-xcuitest-driver/latest/reference/capabilities/ or https://appium.github.io/appium-xcuitest-driver/latest/reference/execute-methods/#mobile-getcontexts with waitForWebviewMs helps for the case.

Dor-bl commented 2 weeks ago

Closed due to no response.