Question: What is correct format for using XPath?

Does XPath vary with the browser?

```
drchrome.findElement(By.xpath("//a[contains(.,'Google')]")).click();

```

Answer: 
Whenever you are trying to locate Hyperlink Element & you have `'/a'` attribute, just forget about the XPath method and try using **linkText** element Locator.

```
<html>
  <head>
    <title>My Page</title>
     <body>
          <a href="http://www.google.com">Google</a>
     <body>
</html>

```

In this situation use: 

```
driver.findElement(By.linkText("Google")).click();

```
When you want to locate Hyperlink Element try **linkText** element Locator or **Partial LinkText**. 

Example using linktext:

```
driver.findElement(By.linkText("click here")).click();  

```

Example using partial linktext:

```
driver.findElement(By.partialLinkText("here")).click();

```