You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We often need to do some strict matching on lists, like checking that all elements satisfy a condition. For example, you have a String[] as the input and you want an elemList to match a criteria that's using the String[] contents :
String[] expectedTexts = ...
new Findr(...).elemList(...).eval(new Function<Object,List<WebElement>>() {
Object apply(List<WebElement> input) {
if (input.size()!=expectedTexts.length) {
return false
}
for (int i=0; i<expectedTexts.length; i++) {
if (!input.get(i).getText().equals(expectedTexts[i])
return false
}
return true
}
}
Of course we'd like the check to be arbitrary, like :
f.elemList(...).whereAllMatch(new f(List<WebElement> l, WebElement e, int index)...
The text was updated successfully, but these errors were encountered:
We often need to do some strict matching on lists, like checking that all elements satisfy a condition. For example, you have a String[] as the input and you want an elemList to match a criteria that's using the String[] contents :
Of course we'd like the check to be arbitrary, like :
The text was updated successfully, but these errors were encountered: