I'm trying to check if an element is visible or not but I get the following error:
Failed: No element found using locator: By(css selector, *[id="button--copy"])
Though this is the point the element shouldn't be visible but instead of going into my if statement it just exits with that error.
Can anyone explain why this is happening?
element(by.id('button--copy')).isDisplayed().then(function (isVisible) {
if (isVisible) {
//do stuff
}
else{
//do stuff
}
});