gpt4 book ai didi

java - Appium 1.13 IOS 12.3.1 切换到 webview(NewTab) 上下文时操作超时

转载 作者:行者123 更新时间:2023-12-02 05:08:58 30 4
gpt4 key购买 nike

切换到 native 弹出窗口后,单击“允许”后,它将不会切换到 Web View ,并且控件不会转到下一个选项卡。我正在获取 Native、Webview_4、Webview_5 等。

错误堆栈跟踪:

May 28, 2019 9:36:30 AM org.openqa.selenium.support.ui.ExpectedConditions findElement WARNING: WebDriverException thrown by findElement(By.xpath: //button[@class='little130 blue']) org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Did not get any response after 20s Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z' System info: host: 'local', ip: 'fe80:0:0:0:c1a:bce1:50e1:ac1d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.4', java.version: '12' Driver info: io.appium.java_client.ios.IOSDriver Capabilities {appiumVersion:
1.9.1, autoAcceptAlerts: true, autoDismissAlerts: true, autoGrantPermissions: true, automationName: XCUITest, browserName: Safari, databaseEnabled: false, deviceName:TS, javascriptEnabled: true, locationContextEnabled: falsenetworkConnectionEnabled: false, newCommandTimeout: 2000,platform: MAC, platformName: iOS, platformVersion: 12.2, safariAllowPopups: false, startIWDP: true, takesScreenshot: true, udid: ****..., unexpectedAlertBehaviour: true, unhandledPromptBehavior: true, webStorageEnabled: false, webkitResponseTimeout: 20000, xcodeOrgId: BYKRN84M2R, xcodeSigningId: iPhone Developer} Session ID: fc7d6ca1-3901-4fb0-a001-69ff9a499308
*** Element info: {Using=xpath, value=//button[@class='little']} at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) atjava.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)atjava.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)

使用了以下代码,但不起作用

Set<String> strcont=null; strcont=driver.getcontextHandles(); 
For(String s: strcont) {
if(s.contains(WEBVIEW)) {
driver.context(s);
}
} catch (Exception e) {
e.printStackTrace();
}

最佳答案

After clicking the "popup" button again switch to webview,give break inside the condition find the below code

Set<String> strcont=null; strcont=driver.getcontextHandles();
For(String s: strcont) {
if(s.contains(WEBVIEW)) {
driver.context(s);
break;
}
} catch (Exception e) {
e.printStackTrace();
}

关于java - Appium 1.13 IOS 12.3.1 切换到 webview(NewTab) 上下文时操作超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56335261/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com