我正在编写一个测试来断言<input>标签中的默认文本值.但是,它不是在打球:
Assert.assertThat(webDriver.findElement(By.id("inputTag")).getText(), Matchers.is("2"));
Run Code Online (Sandbox Code Playgroud)
ale*_*cxe 15
这是input元素 - 您需要获取value属性:
webDriver.findElement(By.id("inputTag")).getAttribute("value")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14249 次 |
| 最近记录: |