无法点击添加新案例按钮,我们有3个不同的服务器和一个服务器,它的工作方式是“值=添加新案例”
<div class="top-buttonbar">
<span class="p-btn-left"><span class="p-btn-right"><span class="p-btn-center">
<button class="p-btn-text add" type="button" onclick="fnAddCase()" style="padding-left:3px">Add New Case</button>
</span></span></span>
<span class="p-btn-left"><span class="p-btn-right"><span class="p-btn-center">
<button class="p-btn-text add" type="button" onclick="fnAddPolicy()" style="padding-left:8px" title="Add Policy">Add Policy</button>
</span></span></span>
</div>
答案 0 :(得分:0)
在添加新案例按钮上click()
,您可以使用以下代码行:
Java:
driver.findElement(By.xpath("//div[@class='top-buttonbar']/span[@class='p-btn-left']//button[@class='p-btn-text add' and contains(.,'Add New Case')]")).click();
Python:
driver.find_element_by_xpath("//div[@class='top-buttonbar']/span[@class='p-btn-left']//button[@class='p-btn-text add' and contains(.,'Add New Case')]").click()