I have been running Protractor tests against Chrome and I have recently encountered a need to test against IE. I follow the standard procedure to set up the selenium server(webdriver-manager update=>webdriver-manager start), then I run my tests using protractor conf.js. My capabilities are straightforward with {"browserName":"internet explorer", "version":"11"}.
I encounter the following error on seemingly random tests runs. I'm using IEDriverServerv3.14.0.
{ WebDriverError: Unable to determine type from: E. Last 1 characters read: E
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08- 02T20:13:22.693Z'
System info: host: '******', ip: '******', os.name: 'Windows
Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '10.0.2'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (C:\Users\admin-jdwyer2\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\admin-jdwyer2\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\admin-jdwyer2\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) name: 'WebDriverError', remoteStacktrace: '' }
I have searched for solutions but the only mention I could find of this error is here. Any help would be greatly appreciated!
It turns out it was a synchronization issue with my code since I'm running tests with Protractor using async/await
. In my conf.js
file I use the onPrepare()
function to set up variables/settings before the test starts. Inside onPrepare()
I was maximizing the window with browser.driver.manage().window().maximize();
. The trouble happened when I didn't use await
to synchronize the browser.driver.manage().window().maximize();
call with the rest of my tests so it would maximize the window randomly near the beginning of the test and throw an error.
I fixed this by making onPrepare()
use async
(ie change onPrepare()
to async onPrepare()
and changing browser.driver.manage().window().maximize();
to await browser.driver.manage().window().maximize();