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

Robot Framework Locator not able to find locator

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

I have been trying to find the locator for my testing in robotframework. Below is my html element block and I am unsure of what is the "stable" locator and test on this. I would sincerely appreciate the xpath or any stable locator.

<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>

I have tried the locator

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

But this is giving me error.

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
0
tijnn 2020-12-08 23:24:01

focus on the element first.

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