Internet Explorer automation crashes when a long test is run that interacts multiple webpages
See original GitHub issueMeta -
OS: Windows 10 Selenium Version: 3.9.0 (IEDriverServer.exe) Browser: Internet Explorer 11
selenium-webdriver (npm): 4.0.0-alpha.1 Node: 8.10.0
Browser Version: 11.909.15063.0 (64-bit)
Expected Behavior -
I should be able to run a long test that interacts with multiple pages without my test crashing.
Actual Behavior -
Webdriver (or Internet Explorer?) crashes when repeatedly loading and interacting with pages with Internet Explorer. This is NOT the only condition under which this bug occurs. It seems that issuing too many Webdriver commands with at least some driver.get() commands mixed in will reliably cause the crash. I consider this to be a SERIOUS BUG because it seems that it can break ANY long test against IE that interacts with more than one page.
The following does NOT seem to cause the crash:
- A long test that never changes pages or reloads the current page
- Only calling driver.get() without interacting with the page
The crash can take a variety of forms. Typically it happens after running for 10-20 minutes and will produce one of the following errors.
- Sometimes the browser page will go white and can no longer be interacted with, causing webdriver to error:
TimeoutError: Timed out waiting for page to load.
- Sometimes the browser page will appear to load, but webdriver will report that an element clearly visible on the page cannot be interacted with:
NoSuchElementError: Unable to find element with css selector == *[id="q"]
- Sometimes Internet Explorer crashes completely, causing the standard Windows error window when a program stops responding:
Internet Explorer has stopped working. A problem caused the program to stop working correctly. Please close the program.
Steps to reproduce -
Execute this code and let the loop repeat for approximately 10-20 minutes. For your convenience I put this code with a package.json and complete setup instructions in this git repo.
(async function example() {
let browser = await new Builder()
.forBrowser('internet explorer')
.build();
let startTime = new Date().getTime();
let currentTime;
let numLoops = 0;
while(true) {
currentTime = new Date().getTime();
numLoops++;
process.stdout.write(`\rReloads: ${numLoops}, elapsed time: ${getElapsedTimeString(startTime, currentTime)} `);
await browser.get('https://google.com');
await browser.findElement(By.name('q')).sendKeys('This will crash soon');
}
})();
function getElapsedTimeString(startTime, endTime) {
let elapsedSeconds = Math.floor((endTime - startTime) / 1000);
let date = new Date(null);
date.setSeconds(elapsedSeconds);
return date.toISOString().substr(11, 8);
}```
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
I am running tests using version 3.12, and here as well the driver stops working. As long as its a single test, it works fine. But as the number of tests increases it stops. I am running a regression suite and I have to run multiple suits at a time, this behavior beats the purpose of regression!
3.11.1 (32 bit): Crashed after 9 minutes.
TimeoutError: Timed out witing for page to load.
3.11.1 (64 bit): Still has the 64-bit slow-typing issue. Did not proceed with test.I also tried some older versions.
3.4.0 (32 bit): Successful run, no sign of defect. I killed it manually after 40 minutes. 3.7.0 (32 bit): Success. 3.8.0 (32 bit): Success.
The defect is not present until 3.9.0.
Edit: Hang on, I’m getting some different results from other tests. Disregard this comment for the moment.
Edit 2: I ran the same tests, but against a different website (not Google). All versions of IEDriverServer show the bug on this site. See my following comment.