How do I get karma webdriver launcher to use my selenium server/grid How do I get karma webdriver launcher to use my selenium server/grid selenium selenium

How do I get karma webdriver launcher to use my selenium server/grid


I've got it working. Two problems had to be fixed from my initial post.

1st Fix: Inside the karma.conf.js file I had to set the hostname to the IP address of the machine that was running karma (i.e. my local machine). Don't set this to the IP address of the selenium server grid hub.

config.set({...hostname: '172.123.123.123',...})

2nd Fix: My karma project package.json file was missing this line in the devDependencies dictionary.

"karma-webdriver-launcher": "~0.2.0",

So the package.json contents looks like:-

{  "name": "MyKarmaProject",  "devDependencies": {    "karma": "~0.12.16",    "karma-chrome-launcher": "~0.1.4",    "karma-firefox-launcher": "~0.1.3",    "karma-html-reporter": "^0.2.3",    "karma-ie-launcher": "~0.1.5",    "karma-webdriver-launcher": "~0.2.0",    "karma-jasmine": "^0.2.2",    "karma-phantomjs-launcher": "^0.1.4",    "karma-typescript-preprocessor": "0.0.7",    "phantomjs": "^1.9.7-12"  }}

I believe if you run from your project directory cmd prompt "npm install" after the package.json file is update it will ensure everything is downloaded and installed correctly.Once this was done the karma runner was able to connect to my selenium grid server hub and request the appropriate browser node from the pool. I hope this question and answer helps someone else in the future!