提交 8d6628cc authored 作者: 孙洁清's avatar 孙洁清

Merge branch 'master' of git.yfzx.zjtys.com.cn:hct/auto-test

...@@ -412,6 +412,7 @@ public class SeleniumExecutor { ...@@ -412,6 +412,7 @@ public class SeleniumExecutor {
} }
private Boolean elementMatch(WebElement webElement, Element element) { private Boolean elementMatch(WebElement webElement, Element element) {
try {
boolean attributesMatch = element.attributes().asList().stream() boolean attributesMatch = element.attributes().asList().stream()
.allMatch(attribute -> Objects.equals(attribute.getValue(), webElement.getAttribute(attribute.getKey()))); .allMatch(attribute -> Objects.equals(attribute.getValue(), webElement.getAttribute(attribute.getKey())));
boolean tagMatch = Objects.equals(webElement.getTagName(), element.tagName()); boolean tagMatch = Objects.equals(webElement.getTagName(), element.tagName());
...@@ -429,6 +430,9 @@ public class SeleniumExecutor { ...@@ -429,6 +430,9 @@ public class SeleniumExecutor {
return attributesMatch && tagMatch; return attributesMatch && tagMatch;
} }
} }
} catch (StaleElementReferenceException e) {
return false;
}
} }
private Map<Attributes, WebElement> removeHistoryElements(Map<Attributes, WebElement> elements) { private Map<Attributes, WebElement> removeHistoryElements(Map<Attributes, WebElement> elements) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论