Selecting a link with Selenium Webdriver?

This should work:

driver.findElement(By.LinkText("Users")).click();

By LinkText is possible


XPath is one of the most exact ways to point the element.

Try this:

driver.findElement(By.XPath("//li[@class='li_class']/a")).Click();

Using a CSS selector:

a[href*=user.xhtml]

Here are some tips for writing cssSelector

 = --> Equals string
^= --> Starts with string
$= --> Ends with string
*= --> Contains 
~= --> Contains in a list