Failed: element not visible
I am trying to access a menu item, but it is returning as not visible. I tried two ways:
var formalizationLink = element(by.id('menu7'));
browser.executeScript("arguments[0].scrollIntoView();", formalizationLink.getWebElement());
formalizationLink.click();
And also:
let formalizationLink = element(by.id("menu7"));
if (formalizationLink.isPresent()) {
formalizationLink.click();
browser.sleep(500);
} else {
return false;
}
The above menu items are working normally, could anyone help me?