【问题标题】:Robot framework: locator for button with no id or name机器人框架:没有 id 或名称的按钮的定位器
【发布时间】:2021-10-31 18:02:42
【问题描述】:

我正在尝试让机器人框架单击 iframe 内的按钮。选择带有select frame 的 iframe 后,找不到按钮的定位器。有什么方法可以正确找到定位器吗?

按钮 HTML:

<button _ngcontent-wwc-c83="" soho-menu-button="" icon="add" menu="add-popupmenu" class="btn-primary btn-icon right-content__add-btn btn-menu has-tooltip hide-focus" _nghost-wwc-c43="" type="button" aria-haspopup="true" aria-controls="add-popupmenu">
   <svg _ngcontent-wwc-c43="" soho-icon="" aria-hidden="true" focusable="false" role="presentation" class="icon">
      <use href="#icon-add"></use>
   </svg>
   <!----><!---->
</button>

【问题讨论】:

    标签: python selenium pycharm robotframework


    【解决方案1】:

    有一个svg 标签,你可能想使用下面的xpath:

    //*[name()='svg' and @class='icon']
    

    在继续下一步之前检查 HTMLDOM 是否有唯一条目。

    【讨论】:

      猜你喜欢
      • 2016-02-14
      • 2020-12-13
      • 1970-01-01
      • 2015-08-12
      • 2017-06-25
      • 2017-11-07
      • 2021-03-16
      • 2021-02-18
      • 2015-11-02
      相关资源
      最近更新 更多