java - 不支持的命令异常 : Method has not yet been implemented error with hybrid Android app using Appium

标签 java selenium appium hybrid-mobile-app appium-android

我正在使用 Appium 为混合 Android 应用程序编写自动化测试用例。 我使用下面的代码行将光标设置在下拉/弹出窗口上:

Set<String> stringSet =  webDriver.getWindowHandles();

但是,这会产生以下错误:

org.openqa.selenium.UnsupportedCommandException: Method has not yet been implemented.

webdriverAppiumDriver的对象。

这是一个混合(Cordova) 移动应用

我的堆栈跟踪:

Apr 03, 2019 4:20:21 PM org.openqa.selenium.remote.ErrorCodes toStatus
INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown method' (405 expected)

org.openqa.selenium.UnsupportedCommandException: Method has not yet been implemented
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'VIKSHAH-M-F1AR', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_152-release'
Driver info: io.appium.java_client.AppiumDriver

更新: 更新JDK后

Apr 10, 2019 12:47:45 PM org.openqa.selenium.remote.ErrorCodes toStatus
INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown method' (405 expected)

org.openqa.selenium.UnsupportedCommandException: Method has not yet been implemented
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'VIKSHAH2-M-F1AR', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_202'
Driver info: io.appium.java_client.android.AndroidDriver

有人遇到过类似的问题吗? 还有其他方法可以使用 Appium 测试下拉菜单吗?

最佳答案

此错误消息...

org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown method' (405 expected)
org.openqa.selenium.UnsupportedCommandException: Method has not yet been implemented Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'VIKSHAH-M-F1AR', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_152-release' Driver info: io.appium.java_client.AppiumDriver

...暗示 WebDriver 变体无法与所需的 WebElement 交互。

您的主要问题是您使用的二进制文件版本之间不兼容,如下所示:

  • 您的 Selenium 客户端 版本是 2018-11-14T08:17:033.141.59,这是最新版本。
  • 您的JDK版本是1.8.0_152-release,它非常古老并且古老

因此,Selenium Client v3.141.59 和 JDK v1.8.0_152-release 之间存在明显的不匹配。

解决方案

关于java - 不支持的命令异常 : Method has not yet been implemented error with hybrid Android app using Appium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55494070/

相关文章:

java - 在java中访问while循环内的值?

java - 循环连接四个网格

java - 如何将泛型参数绑定(bind)到特定的List子类?

java - 我们可以为外部mysql服务器配置spring.datasource.url吗

selenium - WebDriver 中的 JUnit 格式与 WebDriver 支持

macos - 使用npm install -g appium安装appium时找不到.bin/authorize-ios

python - 当我在 selenium 中使用 Click() 时,页面中的动态元素(表)不会更新,因此我无法检索新数据

java - 使用 Selenium webdriver 从自动填充文本框中选择选项

ios - 我无法解析IOS驱动程序页面源

java - 在真实设备上的 appium 中并行运行