I am trying to create a single method to return some boolean values that check whether some of the elements are visible on a webpage.
In that case, I am getting an "unreachable statement" error for the second statement.
So I am looking for a workaround to this problem other than writing single methods for every element separately so that I can Assert whether a whole section of elements is visible by only one method.
This is the code snippet I tried to use:
public boolean verifyDescriptionInfo() {
return element(name).isDisplayed();
return element(age).isDisplayed();
}