user1855680
user1855680

Reputation: 11

How to Click on a button using css selector

Can any one help me how I can click on button 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>

I want to click on Create button using web driver JAVA

Upvotes: 1

Views: 831

Answers (1)

andyf
andyf

Reputation: 3350

If you are using selenium, you can use css seletor as jQuery do. Try:

driver.findElement(By.cssSelector("btn:contains('Create')")).click();

Upvotes: 1

Related Questions