0

I want to click on an element, but I don't know why, before clicking on that element the hover appears. What I need is that if this hover appears, avoid it, such as pressing the ESC key, or if you know any other way.

Here is my code:

await browser.wait(EC.elementToBeClickable(element.all(by.className('center-align short-label white mf-show-type-episode')).first()), waitLongTime);
var elements_master = await element.all(by.className('center-align short-label white mf-show-type-episode'));
await elements_master[0].click();
    
var row_selected = browser.element(by.className('ui-grid-row ng-scope ui-grid-row-selected')).element(by.className('field-link ng-binding'));
await browser.sleep(500);
if(await tooltip.isDisplayed() == true) {
    await tooltip.sendKeys(protractor.Key.ESCAPE);
    await row_selected.click();
} else {        
    await row_selected.click();
}

It gives me an error that the tooltip is not interactable.

Mario Ramos García
  • 755
  • 3
  • 8
  • 20

1 Answers1

1

you can use javscript click described here

var loginButton = element(by.css('.login-form .login-button'));
browser.executeScript("arguments[0].click();", loginButton);

you can also call it "forced" click, because what it does is - it clicks on the element regardless its visibility. And even if there is another element on top of it, it will click the element you pass

Sergey Pleshakov
  • 7,964
  • 2
  • 17
  • 40