UnknownError: Error forwarding the new session Empty pool of VM for setup Capabilities [{count=1, browserName=chrome}]
Hello everyone, I am trying to run protractor tests from jenkins which is installed on AWS. I have protractor.config.js file which is as below:
exports.config = { allScriptsTimeout: 11000, seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['*.spec.js'],
capabilities: { 'browserName': 'chrome' },
resultJsonOutputFile: 'test/protractor/protractor.log.json',
framework: 'jasmine', jasmineNodeOpts: { // defaultTimeoutInterval: 60000 } }
Now In jenkins shell script I am passing two command as below: UI/node_modules/protractor/bin/webdriver-manager start ( to start the webdriver ) protractor UI/test/protractor/protractor.conf.js ( to run the tests).
The jenkins workspace has the latest git code and on running the jenkins job, getting error as :
10:11:40.629 WARN - Failed to start: [email protected]:4444
Running as a standalone server:
Usage: java -jar selenium-server.jar [-interactive] [options]
-port
-dontInjectRegex <regex>: an optional regular expression that
proxy injection mode can use to know when to bypss injection
-userJsInjection <file>: specifies a JavaScript file which will
then be injected into all pages
-userContentTransformation <regex> <replacement>: a regular
expression which is matched against all test HTML content; the
second is a string which will replace matches. These flags can
be used any number of times. A simple example of how this could
be useful: if you add "-userContentTransformation https http"
then all "https" strings in the HTML of the test application will
be changed to be "http".
This synopsis lists options available in standalone role only. To get help on the options available for other roles run the server with -help option and the corresponding -role option value. java.net.BindException: Selenium is already running on port 4444. Or some other service is. at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:509) at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:321) at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:240) at org.openqa.grid.selenium.GridLauncher$1.launch(GridLauncher.java:58) at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:127) Selenium Standalone has exited with code 0
- protractor UI/test/protractor/protractor.conf.js Using the selenium server at http://localhost:4444/wd/hub [launcher] Running 1 instances of WebDriver
/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108 var template = new Error(this.message); ^ UnknownError: Error forwarding the new session Empty pool of VM for setup Capabilities [{count=1, browserName=chrome}] at new bot.Error (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108:18) at Object.bot.response.checkResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:109:9) at /usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:160:24 at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14) at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21) at goog.async.run.processWorkQueue (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:124:15) at process.tickCallback (node.js:364:9) From: Task: WebDriver.createSession() at Function.webdriver.WebDriver.acquireSession (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30) at [object Object].Builder.build (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22) at [object Object].DriverProvider.getNewDriver (/usr/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:42:27) at [object Object].Runner.createBrowser (/usr/lib/node_modules/protractor/lib/runner.js:190:37) at /usr/lib/node_modules/protractor/lib/runner.js:280:21 at _fulfilled (/usr/lib/node_modules/protractor/node_modules/q/q.js:834:54) at self.promiseDispatch.done (/usr/lib/node_modules/protractor/node_modules/q/q.js:863:30) at Promise.promise.promiseDispatch (/usr/lib/node_modules/protractor/node_modules/q/q.js:796:13) at /usr/lib/node_modules/protractor/node_modules/q/q.js:556:49 [launcher] Process exited with error code 1
Hi there,
Please format your issue according to the issue template and properly format your code blocks (otherwise they are very difficult to read).
My suspicion is that this is an issue with your Jenkins setup and not Protractor. If that is the case, your question is better asked on StackOverflow, Gitter, or in a jenkins specific channel.
java.net.BindException: Selenium is already running on port 4444. Or some other service is.
I agree with @NickTomlin that this is probably a setup problem with the job and would be better on StackOverflow, Google Group discussion list, or Gitter. Either you have an existing selenium already running on port 4444 (maybe your jobs are running concurrently and every job launches webdriver), or a service is running on port 4444.
Any solution for above question?