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")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With