Element not Visible - Protractor

Asked

Viewed 36 times

0

Failed: element not Visible

I am trying to access a menu item, but it is returning as not visible. I tried it in 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 menu items above this are working normally, someone could help me?

1 answer

0

Hi. I’m also new to the developer. Do you just want to click on the element with the menu7 ID? If that’s it, you can do it the simple way:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.