cis
cis

Reputation: 1377

Karma tests remotely on Selenium 3 hub

I run Karma JavaScript unit tests remotely on a Selenium hub with Chrome 66, Firefox 59, and Internet Explorer 11 on a Windows 7 VM. That worked well for Selenium 2. However, I recently had to update to Selenium 3.12 - and now only Chrome works, while on Firefox or Internet Explorer a browser window will open, but nothing else. The tests will not start on them. However, end-to-end tests with Protractor 5.3 work on both browsers. So, it seems that the Selenium 3 hub and its nodes are working correctly, while the actual problem is somehow connected to Karma and its launchers.

I cannot find any karma-(webdriver)-selenium-launcher which seems to support Selenium 3.

The relevant part of my Karma config looks like this (for IE, Firefox is similar):

customLaunchers: {
      'remote_ie': {
          base: 'WebDriver',
          browserName: 'internet explorer',
          config: {
            hostname: '...',
            port: '4444'
          },
          platform: 'ANY',
          version: 'ANY'
       }

As launchers (base), I've tried installing and using karma-selenium-webdriver, karma-webdriver-launcher, karma-selenium-webdriver-launcher - to no avail.

The Selenium node config for the Internet explorer VM:

    { 
     "capabilities": [
        {
         "browserName": "internet explorer",
         "version": "ANY",
         "platform": "ANY",
         "maxInstances": 4,
         "seleniumProtocol":"WebDriver",
         "ie.ensureCleanSession":true,
         "ie.forceCreateProcessApi":true,
         "ie.browserCommandLineSwitches": "-private"
        }],

    "nodeTimeout": 120,
    "port": 4411,
    "nodePolling": 2000,
    "registerCycle": 10000,
    "register": true,
    "cleanUpCycle": 2000,
    "timeout": 30000,
    "maxSession": 4
    }

Additional infos on versions used:

Karma: 2.0.2; geckodriver: 0.20; Internet Exlorer driver: 3.12.0 32-bit version

Update: updated Selenium to version 3.12 - didn't change anything.

Upvotes: 1

Views: 823

Answers (1)

Try karma-selenium-grid-launcher. It uses selenium-webdriver instead of wd.js (only selenium 2)

Upvotes: 1

Related Questions