java Selenium如何在div中单击“p”标记
这是html。我需要点击“addBtn”
<div class="shuffle-container">
<p class="addBtn"></p>
<p class="removeBtn"></p >
</div>
驱动程序高亮显示与类“addBtn”相关的按钮,但没有发生单击事件
这是我的selenium代码:
driver.findElement(By.className("addBtn")).click();
你可以在下面搜索框中键入要查询的问题!
这是html。我需要点击“addBtn”
<div class="shuffle-container">
<p class="addBtn"></p>
<p class="removeBtn"></p >
</div>
驱动程序高亮显示与类“addBtn”相关的按钮,但没有发生单击事件
这是我的selenium代码:
driver.findElement(By.className("addBtn")).click();
# 1 楼答案
从API开始: