I have element,for example //div[@class='create-button'].
My test assert that for some users without admin rights this button not visible.
Assert.False(pageObject.IsElementDisplayed());
where:
public bool IsElementDisplayed() {
try{
element.Displayed;
return true;
}
catch(NotFoundElementException){
return false;
}
}
Someone in my team change button class. Locator is broken. Now method IsElementDisplayed() always return false and my test always pass. This is a false positive result. How to avoid such results?