Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor click not working in IE, but works in chrome

i have some div that looks like this

<div class="someClassyStuff" on-tap="foo(param)"> Text </div>

within protractor we search and find the div element, check that the text matches our expectations, then call click() on that element. The test works fine in Chrome, but in IE it's as if no click happens.. breaking the test.

Does IE 11 support on-tap?

I've tried changing to ng-click="foo(param)" but with no effect.

like image 950
Erik Avatar asked Oct 25 '25 08:10

Erik


2 Answers

I solved this problem with these capabilities:

exports.config = {
    capabilities: {
        'browserName': 'internet explorer',
        'version': 11,
        'nativeEvents': false,
        'unexpectedAlertBehaviour': 'accept',
        'ignoreProtectedModeSettings': true,
        'enablePersistentHover': true,
        'disable-popup-blocking': true
    }
};

You can use the same in your browserstack setup:

exports.config = {
    capabilities: {
        'browser' : 'ie',
        'browserName': '',
        'browser_version' : '11',
        'os' : 'Windows',
        'os_version' : '7',
        'browserstack.user': 'XXX',
        'browserstack.key': 'XXX',
        'version': 11,
        'nativeEvents': false,
        'unexpectedAlertBehaviour': 'accept',
        'ignoreProtectedModeSettings': true,
        'enablePersistentHover': true,
        'disable-popup-blocking': true
    }
};

Found solution at Software Quality Assurance & Testing.

like image 51
crashbus Avatar answered Oct 28 '25 04:10

crashbus


With automating IE browser, it's always something special. Try clicking the link "via javascript":

var elm = element(by.css("div.someClassyStuff"));
browser.executeScript("arguments[0].click();", elm.getWebElement());
like image 38
alecxe Avatar answered Oct 28 '25 03:10

alecxe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!