标签:判断 status try mep ebe res stat drive false
//判断元素是否存在
public boolean IsElementPresent (WebElement webElement, By by) {
boolean status = false;
try {
if (webElement == null) {
driver.findElement(by);
status = true;
}else {
webElement.findElement(by);
status = true;
}
} catch (NoSuchElementException e) {
status = false;
}
return status;
}
//判断标签是否存在
public boolean IsTagNamePresent (WebElement webElement, String tagName) {
boolean status = false;
if (!webElement.getAttribute(tagName).equals("")){
status=true;
}else {
status=false;
}
return status;
}
标签:判断 status try mep ebe res stat drive false
原文地址:https://www.cnblogs.com/xxsl/p/10101158.html