I have a problem here where I need to search for an exact text using selenium. I would like to search for exact text with value "SER20170905111755" but in actual fact, there is another similar text with value "SER20170905111755 - AF-CR-613" on the page also. 

I have tried using this 

```
String text = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(., 'SER20170905104010')]"))).getText();

```

it returns "SER20170905111755 - AF-CR-613" to me. Then i tried with 

```
String text = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[text()='SER20170905104010']"))).getText();

```

it throws TimeOut exception. Seems it can't locate the text. But, if I replace it with this 

```
String text = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[text()='SER20170905104010']"))).getText();

```

it returns the expected value I need, which is "SER20170905111755". Below is the HTML code of the page for both texts

1. SER20170905111755 - AF-CR-613
[![enter image description here](https://i.stack.imgur.com/3oOUN.jpg)](https://i.stack.imgur.com/3oOUN.jpg)
2. SER20170905111755
[![enter image description here](https://i.stack.imgur.com/tf50m.jpg)](https://i.stack.imgur.com/tf50m.jpg)

Can you please help how can I perform exact text search by using //\* instead of //div?