Refactor SeleniumExample
This commit is contained in:
parent
be5ac17249
commit
75a0274fe8
|
@ -40,6 +40,7 @@ public class SeleniumExample {
|
||||||
if (webElementList != null) {
|
if (webElementList != null) {
|
||||||
webElementList.stream()
|
webElementList.stream()
|
||||||
.filter(webElement -> "Close".equalsIgnoreCase(webElement.getAttribute("title")))
|
.filter(webElement -> "Close".equalsIgnoreCase(webElement.getAttribute("title")))
|
||||||
|
.filter(WebElement::isDisplayed)
|
||||||
.findAny()
|
.findAny()
|
||||||
.ifPresent(WebElement::click);
|
.ifPresent(WebElement::click);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue