Warm tip: This article is reproduced from serverfault.com, please click

selenium-Robot Framework Locator无法找到定位器

(selenium - Robot Framework Locator not able to find locator)

发布于 2020-12-04 00:30:25

我一直在尝试找到用于我在robotframework中进行测试的定位器。下面是我的html元素块,我不确定什么是“稳定”定位器并对此进行测试。我衷心感谢xpath或任何稳定的定位器。

<div class="sc-jXcwIi bnswfh cosmos-layout-child" data-cosmos-key="stack-layout.item"><div data-cosmos-key="row-layout" class="sc-bQCGiA fFRDIw"><div class="sc-fXgAFM cosmos-layout-child" data-cosmos-key="row-layout.item">deploy-extension</div><div class="sc-fXgAFM cosmos-layout-child" data-cosmos-key="row-layout.item"><span data-cosmos-key="text" type="allcaps" class="sc-fujyUd cWWTbP">MACHINE TO MACHINE</span></div></div></div>

我已经尝试过定位器

Click Element                       xpath://div[contains(text(), "deploy-extension")]

但这给了我错误。

export existing tenant               | FAIL |
ElementClickInterceptedException: Message: element click intercepted: Element <div class="sc-fXgAFM cosmos-layout-child" data-cosmos-key="row-layout.item">...</div> is not clickable at point (431, 355). Other element would receive the click: <p data-cosmos-key="paragraph" class="sc-dlnjPT corHA">...</p>
  (Session info: headless chrome=87.0.4280.66)

Questioner
vgdub
Viewed
12
tijnn 2020-12-08 23:24:01

首先关注元素。

Set Focus To Element       xpath://div[contains(text(), "deploy-extension")]