Refactor SeleniumExample

This commit is contained in:
Grzegorz Piwowarek 2016-11-17 07:46:38 +02:00
parent be5ac17249
commit 75a0274fe8
1 changed files with 1 additions and 0 deletions

View File

@ -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);
} }