首页 > 解决方案 > 如何将 WebDriver 的焦点从 Native App 切换到 Web 授权页面

问题描述

无法为标题提出正确的措辞,但将在此处解释:

所以我m testing native iOS app and at some point user need to connect fitBit Account. So When user tap on Connect => He redirected to fitBit auth page which is webview. While i一直在 browserStack 中运行测试,这个网页上的所有元素都是可交互的,我没有问题。但是在模拟器上,当这个网页打开时,Appium 日志会检测到新的应用程序

我对切换上下文感到满意,但是当我尝试打印出所有可用上下文的数组时,我只打印了一个(MyApp_NATIVE)

Appium 日志检测到这一点:

[debug] [RemoteDebugger]     "WIRTitleKey": "Fitbit",
[debug] [RemoteDebugger]     "WIRTypeKey": "WIRTypeWeb",
[debug] [RemoteDebugger]     "WIRURLKey": "https://accounts.fitbit.com/login?. ....... blablalblalbla 

我可以使用上述值之一来切换驱动程序的焦点吗?

如何使驱动程序识别此网页上的元素。

标签: seleniumappiumui-automationxcuitest

解决方案


推荐阅读