【发布时间】:2018-12-23 19:04:59
【问题描述】:
我想在范围报告中显示 Web 元素的名称(在我的示例中为“USER_LOGIN”); 如何获得?
我尝试使用getText(),但结果为空白。
例如这是网站代码:
<input class="form_control w100p ffg big" type="text"
name="USER_LOGIN" value="lpelet2@gmail.com" maxlength="255" placeholder="E-mail">
这就是我想要做的:
public void verifyElementExist(WebElement weElem) throws ParserConfigurationException, SAXException, IOException
{
try
{
weElem.isDisplayed();
extnTest.log(LogStatus.INFO, "Element exist - " + weElem.getText());
}
catch (Exception e)
{
...
}
}
【问题讨论】:
标签: selenium junit extentreports