【问题标题】:Unable to locate elements using XPath in Robot Framework无法在 Robot Framework 中使用 XPath 定位元素
【发布时间】:2021-03-27 00:08:41
【问题描述】:

我正在尝试将文本输入到 XCUIElementTypeSecureTextField。到目前为止,我已经尝试了以下方法:

Input Text    //XCUIElementTypeTextField[@name="Email"]    abcd@gmail.com

元素可见,但收到错误消息

ValueError:元素定位器 '//XCUIElementTypeSecureTextField[@name="Password"]' 不匹配任何 元素。

我使用的是 iOS SDK 版本:14.0 和 Appium 版本:1.19.1

我的 DOM:

<XCUIElementTypeTextField type="XCUIElementTypeTextField" value="Email" name="Email" label="" enabled="true" visible="true" x="35" y="395" width="344" height="41"/>

【问题讨论】:

    标签: xcode appium robotframework appium-ios


    【解决方案1】:
    Input Text    xpath=//XCUIElementTypeTextField[@name="Email"]    abcd@gmail.com
    

    为什么不使用 name=? (这也很容易工作)

    Input Text  name=Email  Test
    

    How do I use Click Element function with robot framework when the element does not have id or name?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-11
      • 2016-07-01
      • 2014-07-27
      • 2020-10-17
      • 1970-01-01
      • 2017-02-21
      • 2021-08-01
      • 2016-09-30
      相关资源
      最近更新 更多