2

I'm trying to click on a button 'users' inside a the following div:

 <div class="tabs">
   <button tab="0" >Users</button>
   <button tab="1">Groups</button>
   <button tab="2">Lifecycle Management</button> 
   <button tab="3">Features</button>
   <button tab="4">Databases</button>
 </div>

I already tried using this but it didnt work

driver.FindElements(By.CssSelector("div.tabs button.users"))

Anyone got a clue? Thank you!

1 Answer 1

4

Users it the text, not a class. You can't use CssSelector to locate by text, but you can use Xpath

driver.FindElements(By.Xpath("//div[@class='tabs']/button[.='Users']"));
Sign up to request clarification or add additional context in comments.

Comments

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.