【发布时间】:2021-09-09 09:57:58
【问题描述】:
::before
我在现场有以下结构,::before 是我应该点击的复选框,找到了一些主题,但没有@FindBy 注释。是否可以在代码中找到这个 ::before?
<span class="jJ">
<label class="kJ" data-test-id="checkbox_bonus_card">
<input class="mJ" type="checkbox" name="hasBonusCard" value="">
<span data-test-id="checkbox_bonus_card_text" class="lJ">
::before
</span>
</label>
</span>
我试过@FindBy(xpath = "//label[@data-test-id='checkbox_bonus_card'//span['::before']"),但没用。
如果我使用这样的东西:
@FindBy(xpath = "//input[@name='hasBonusCard']")
WebElement checkboxBonusCard;
出现错误:
Caused by: ElementClickInterceptedException: element click intercepted: Element <input class="mJ" type="checkbox" name="hasBonusCard" value=""> is not clickable at point (568, 78). Other element would receive the click: <span class="jJ">...</span>
【问题讨论】:
标签: java css selenium xpath findby