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?