protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Click on hidden element works on Chrome, but not on Firefox and IE

Open chun2014 opened this issue 12 years ago • 3 comments

I have a scenario that when I move mouse over a web element, a hidden image display, and click on it pop up an alert box for now. The following piece of code works well on Chrome, but the same code won't work in Firefox and IE. In Firefox click won't open alert box, and complain "No alert present", in IE it says "element no longer valid" at the statement of img.click()

element(by.css("... ...")).then(function(element) {
  ptor.actions().
    mouseMove(element).
    perform();

  element(by.css("... ...")).then(function(img) {
    img.click();
    var alertDialog = browser.switchTo().alert();
    alertDialog.accept();
  })
});

It seems to be a bug in Firefox and IE, click on hidden element won't work in these browsers, but works well in Chrome.

I'm using the latest version of Protractor: version 1.0.0

chun2014 avatar Aug 11 '14 04:08 chun2014

The latest version of protractor is 1.1.1

Have you tried doing these manually in those browsers?

eddiemonge avatar Aug 26 '14 21:08 eddiemonge

This is probably an issue with IE/Firefox implementations of webdriver. Could you share the HTML/css for your hidden element?

juliemr avatar Aug 27 '14 19:08 juliemr

I'm going through and cleaning up by closing stale questions. Please re-open if there is a current bug or feature request. If you have a question, consider Stack Overflow.

juliemr avatar Sep 23 '14 18:09 juliemr