title: Selenium WebDriver findElement(By.xpath()) not working for me
body: <p>I've been through the xpath tutorials and checked many other posts, hence I'm not sure what I'm missing.  I'm simply trying to find the following element by xpath:</p>
  
  <pre><code>&lt;input class="t-TextBox" type="email" test-id="test-username"/&gt;
  </code></pre>
  
  <p>I've tried many things, such as:</p>
  
  <pre><code>element = findElement(By.xpath("//[@test-id='test-username']"));
  </code></pre>
  
  <p>The error is <code>Expression is not a legal expression</code>.</p>
  
  <p>I'm using Firefox on MacBook</p>
  
  <p>Any suggestion would be greatly appreciated.</p>