Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以帮助我如何单击按钮 HTML
<div class="row"> <div class="span16"> <div class="pull-right"> <a class="btn primary" href="/v2/admin/user/edit" style="background-color: rgb(54, 67, 149);">Create</a> </div> </div> </div>
我想使用 Web 驱动程序 JAVA 单击创建按钮
如果你使用 selenium,你可以像 jQuery 一样使用 css 选择器。尝试:
driver.findElement(By.cssSelector("btn:contains('Create')")).click();