【问题标题】:Using UI Automator as the locator when using Appium and RobotFramework使用 Appium 和 RobotFramework 时使用 UI Automator 作为定位器
【发布时间】:2016-05-31 10:40:08
【问题描述】:

我正在尝试使用UI Automator 作为单击某些元素的定位器。作为参考,我使用RobotFrameworkrobotframework-appiumlibrary

我尝试使用的 sn-p 是:

Click Element  android=new UiSelector().description('arbitraryDescription')

来自the documentation,看起来应该可以了。

但是每次都会失败,输出如下:

WebDriverException:消息:请求的资源不能 找到,或使用未使用的 HTTP 方法接收到请求 受映射资源支持。

我很困惑,因为我显然没有尝试调用 WebDriver,而且我不知道为什么我会得到它而不是 UI Automator。

【问题讨论】:

  • 澄清一下,只要您调用“Click Element”,您就是在调用 WebDriver。 Robot 框架本身无法与网页交互,它需要一个库,例如 Selenium 或 Appium。这些 Selenium 和 Appium 库所做的主要是抽象您需要对 WebDriver 进行的调用以获得预期的结果。

标签: android appium robotframework


【解决方案1】:

结果证明文档是错误的,如下所述:https://github.com/jollychang/robotframework-appiumlibrary/issues/96

以下是文档所说的应该起作用的内容:

Click Element android=new UiSelector().description('arbitraryDescription')

这才是真正有效的:

Click Element android=UiSelector().description('arbitraryDescription')

我进行了相关编辑并创建了一个拉取请求,希望没有其他人陷入我所做的陷阱。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-21
    • 2021-07-14
    • 1970-01-01
    • 2015-03-27
    • 1970-01-01
    • 1970-01-01
    • 2016-09-06
    相关资源
    最近更新 更多