I'm writing a test to assert the default text value within an <input>
tag. However, it's not playing ball:
Assert.assertThat(webDriver.findElement(By.id("inputTag")).getText(), Matchers.is("2"));
This is the input
element - you need to get the value
attribute:
webDriver.findElement(By.id("inputTag")).getAttribute("value")