How to configure protractor with Internet Explorer
I will assume that there’s no need on to describe how to install and run Protractor, however, here’s a quick summary:
You have to install Java, Node JS, and my personal preference, Cmder (this is not mandatory, windows cmd line works just fine)
First of all, you need IEDriverServer.
I will try to make this as simple as possible. The proper way to get and install this is, by using protractor’s built-in functionality.
Install Webdriver-manager and gulp, globally.
webdriver-manager gulp -g
Browse to node_modules/protractor/bin and run
npm webdriver-manager --standalone update
npm webdriver-manager --ie update
Then, you will need to manually start the webdriver server
For this, you will need to run
npm webdriver-manager --ie start
As simple as that.
After that, the 2nd step is to get the config file right. The spicy and “different” stuff is: Capabilities, direct connect, and LocalSeleniumStandaloneOpts
Necessary and Important examples for config file, in order to run the spec test suite:
'browserName': 'internet explorer',
args: ['--silent', '--no-sandbox', '--test-type=browser', '--lang=US', '--start-maximized'], //,'--headless', '--disable-gpu'
'default_directory': process.cwd() + '/downloads/'
The 3rd step is to disable protractor sync (I’m really sorry, but this won’t work otherwise)
In order to do that, you’ll have to disable the Protractor Synchronization.
browser.ignoreSynchronization = true;
The 4th step is to mimic the protractor’s sync with Angular. For that, you can use SmartWaits. I’ve described Smart Waits for Protractor in a previous article, here.
5th step is to disable Protected Mode for Internet Explorer browser in order to run Protractor tests.
You’ll need to disable the “Protected mode” for Internet, Local Internet, Trusted Sites and Restricted sites.
After that, you’ll be good to go.
I’ve created a demo repository, just to exemplify exactly how does Internet Explorer configuration work for Automation Testing. The repository can be found here: https://github.com/sdet-ro/Protractor-Internet-Explorer-Demo-example
If you need any help testing with Internet Explorer, don’t hesitate to reach out to me!
You can get in touch with me by sending me an email here: https://sdet.ro/contact
Also published on Medium.