title: Click on row By Finding Text in <td> tag in Selenium
body: <p>My html code is:</p>
  
  <pre><code>enter code here:
  &lt;table&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td class="item item-selected" id="gwt-uid-537" role="menuitem"&gt;Test Customer 1&lt;br&gt;#34&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
        &lt;td class="item" id="gwt-uid-538" role="menuitem"&gt;TEST CUSTOMER 2&lt;br&gt;#1,9874563210&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
        &lt;td class="item" id="gwt-uid-539" role="menuitem"&gt;test &lt;br&gt;test&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>What i want to do is just find the Customer Name (for ex: TEST CUSTOMER 2) before break-line tag and then click on that row.</p>
  
  <p>I have tried as follows:</p>
  
  <pre><code>String ExpCustName = "TEST CUSTOMER 2";
  
  Thread.sleep(1000);
  
  WebElement FindCust = driver.findElement(By.xpath("//div[@class='customer']/table/tbody/tr/td/input[@class='gwt-SuggestBox']"));
  FindCust.sendKeys("TES");
  
  List&lt;WebElement&gt; CustList = driver.findElements(By.xpath("//div[@class='suggestPopupMiddleCenterInner suggestPopupContent']//table//tr"));
  
  for(int i=0;i&lt;CustList.size();i++){
      String ActCustName = CustList.get(i).getText();
      System.out.println(ActCustName);
  
      Thread.sleep(1000);
      if(ActCustName.contains(ExpCustName)){
          CustList.get(i).click();
      }
  } 
  </code></pre>