Internet Explorer 11 does not close after Selenium test

We have several Windows Server 2012 machines installed on Google Cloud, where we run Selenium tests. They work with Mocha in NodeJS. Chrome and Firefox start, start, and close as expected, but IE 11 does not close. As a result, the selenium server stops responding, and all tests in IE start to fail.

Here is the code for mine before and after each hook

// Launches browser, opens homepage, and closes the popup.
exports.beforeEach = function(capability) {
   driver = utils.driver.launch(capability);
   utils.driver.open(driver);
   utils.driver.closePopup(driver);
}

exports.afterEach = function() {
  driver.quit();
}

The features that I installed are as follows

{
  browserName: browser,
  version: version,
  screenResolution: resolution,

  requireWindowFocus: true,
  unexpectedAlertBehaviour: "dismiss",
  ignoreProtectedModeSettings: false,
  ignoreZoomSetting: false,
  nativeEvents: true,
  handlesAlerts: true,
  javascriptEnabled: true,
  enableElementCacheCleanup: true,
  cssSelectorsEnabled: true,
  usePerProcessProxy: false,
  elementScrollBehavior: 0,
  enablePersistentHover: false,
  pageLoadStrategy: "normal",

  ie: {
    ensureCleanSession: true,
    forceCreateProcessApi: true,
    browserCommandLineSwitches: "-private"
  }
}

.close(), driver.quit(), IE , , . IE , . , .

+3
2

IE webdriver, -, , Java , .

  try {
Runtime.getRuntime().exec("taskkill /F /IM IEDriverServer.exe");
} catch (IOException e) {
e.printStackTrace();
}

, , , , . .

, Murali

0

@Sonny , , "iexplorer.exe"

:

    taskkill /f /fi "pid gt 0" /im IEDriverServer.exe
    taskkill /f /fi "pid gt 0" /im iexplore.exe
+3

All Articles