Element not visible - Protractor

0

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?

    
asked by anonymous 11.09.2017 / 20:04

1 answer

0

Hi. I'm also new to the protractor. Do you just want to click on the element with the ID 'menu7'? If so, you can do it in the simplest way:

element(by.id('menu7')).click().then(() =>{
      //Fazer alguma coisa depois do menu estiver aberto
});
    
09.10.2017 / 23:41