I have while loop which is supposed to run while condition1 is true or while condition2 is true. 1 or 2 case depends on some initial boolean condition.
Now I implemented this as a ternary operator, but I'd like to understand how this can be done using a Predicate, and lambda expressions.
Can someone provide an example please? How can I declare a Function variable and put it into the while loop condition?
boolean initialCondition = stopBtn.getText().length() > 0;
while(initialCondition ? stopBtn.waitToBeHidden() : stopBtn.isDisplayed()) {
if (a++ < 5) {
stopBtn.click();
}
}
return this;