Selenium WebDriver get text from input field
<p>I'm writing a test to assert the default text value within an <code>&lt;input&gt;</code> tag. However, it's not playing ball:</p>

<pre><code>Assert.assertThat(webDriver.findElement(By.id("inputTag")).getText(), Matchers.is("2"));
</code></pre>