1

I'm learning Protractor by making a very simple test:

describe('Tick Tack Toe game', function() {
  it('marks positions as played', function() {
    browser.ignoreSynchronization = true;
    browser.get('file:///C:/Users/potero/angular/Angular_TickTackToe/ticktacktoe.html');
    var p00 = element(by.id("p00"));
    p00.click();
    expect(p00.getText()).toEqual("X");
  });
});

This test passed in Chrome almost effortlessly. But I also have to test on IE so I added the necessary lines to my protractor conf file which ended up like this:

exports.config = {
    seleniumAddress : 'http://localhost:4444/wd/hub',
    specs : [ '../specs/**/*.protractorspec.js' ],
    multiCapabilities: [{
          'browserName': 'internet explorer'
        }, {
          'browserName': 'chrome'
        }]
};

Chrome kept passing the test but IE could not be launched due to its protected mode settings being different for every zone. I made them equal, which I read on this SO question. Then IE was launched but the test failed cause IE could not find the element with id p00 (check my spec above). By reading the error output on the console I saw the property of the IE selenium driver called "ignoreProtectedModeSettings" which was set to false. This got my attention so I reset the protected mode settings in IE and added a line to my protractor conf file, which ended up like this:

exports.config = {
    seleniumAddress : 'http://localhost:4444/wd/hub',
    specs : [ '../specs/**/*.protractorspec.js' ],
    multiCapabilities: [{
          'browserName': 'internet explorer',
          'ignoreProtectedModeSettings': true
        }, {
          'browserName': 'chrome'
        }]
};

And the IE test passed. Every time I ran it. So, why does a property that has to do with security settings allow me to find elements by id using Protractor selectors?

Community
  • 1
  • 1
Pedro Otero
  • 324
  • 5
  • 15

1 Answers1

2

Background on Protected Mode

Internet Explorer’s Protected Mode is a security sandbox that relies upon the integrity level system in Windows. A process may have only one integrity level (IL), so if you navigate an IE instance between a Internet (Protected Mode, LowIL) and Intranet (non-Protected Mode, MediumIL) site, Internet Explorer must handle the navigation in a new process. In IE7 on Vista, this was very visible—a new browser window would open automatically. In IE8, with the introduction of Loosely-Coupled IE (LCIE), we can handle this more subtly.

You can find more information here: http://blogs.msdn.com/b/ieinternals/archive/2011/08/03/internet-explorer-automation-protected-mode-lcie-default-integrity-level-medium.aspx