1

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

1

1 Answer 1

1

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

driver.findElement(By.cssSelector("btn:contains('Create')")).click();
Sign up to request clarification or add additional context in comments.

1 Comment

not working it shows following error Exception in thread "main" org.openqa.selenium.WebDriverException: An invalid or illegal string was specified Command duration or timeout: 9 milliseconds Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:45' at Shingo.main(Shingo.java:148) Caused by:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.