I declare a button as field in following fashion:
@AndroidFindBy(name = "Schedule")
private WebElement calendarButton;
... and later I make sure it's NOT displayed because the app is in some special mode.
Assert.assertFalse(this.calendarButton.isDisplayed());
It gives me org.openqa.selenium.NoSuchElementException, but the test is failed. Any ideas how can I make such assertion?
The thing I don't want to define By condition a few times in the code, so using property is handy.