protractor icon indicating copy to clipboard operation
protractor copied to clipboard

UnknownError: Error forwarding the new session Empty pool of VM for setup Capabilities [{count=1, browserName=chrome}]

Open kalyan-K-79 opened this issue 10 years ago • 3 comments

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 : the port number the selenium server should use (default 4444) -timeout : an integer number of seconds we should allow a client to be idle -browserTimeout : an integer number of seconds a browser is allowed to hang -interactive: puts you into interactive mode. See the tutorial for more details -singleWindow: puts you into a mode where the test web site executes in a frame. This mode should only be selected if the application under test does not use frames. -profilesLocation: Specifies the directory that holds the profiles that java clients can use to start up selenium. Currently supported for Firefox only. -forcedBrowserMode : sets the browser mode to a single argument (e.g. "_iexplore") for all sessions, no matter what is passed to getNewBrowserSession -forcedBrowserModeRestOfLine : sets the browser mode to all the remaining tokens on the line (e.g. "_custom /some/random/place/iexplore.exe") for all sessions, no matter what is passed to getNewBrowserSession -userExtensions : indicates a JavaScript file that will be loaded into selenium -browserSessionReuse: stops re-initialization and spawning of the browser between tests -avoidProxy: By default, we proxy every browser request; set this flag to make the browser use our proxy only for URLs containing '/selenium-server' -firefoxProfileTemplate

: normally, we generate a fresh empty Firefox profile every time we launch. You can specify a directory to make us copy your profile directory instead. -debug: puts you into debug mode, with more trace information and diagnostics on the console -browserSideLog: enables logging on the browser side; logging messages will be transmitted to the server. This can affect performance. -ensureCleanSession: If the browser does not have user profiles, make sure every new session has no artifacts from previous sessions. For example, enabling this option will cause all user cookies to be archived before launching IE, and restored after IE is closed. -trustAllSSLCertificates: Forces the Selenium proxy to trust all SSL certificates. This doesn't work in browsers that don't use the Selenium proxy. -log : writes lots of debug information out to a log file and disables logging to console -logLongForm: writes information out to console in long format (for debugging purpose) -htmlSuite : Run a single HTML Selenese (Selenium Core) suite and then exit immediately, using the specified browser (e.g. "*firefox") on the specified URL (e.g. "http://www.google.com"). You need to specify the absolute path to the HTML test suite as well as the path to the HTML results file we'll generate. -proxyInjectionMode: puts you into proxy injection mode, a mode where the selenium server acts as a proxy server for all content going to the test application. Under this mode, multiple domains can be visited, and the following additional flags are supported:

-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

kalyan-K-79 avatar Mar 03 '16 10:03 kalyan-K-79

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.

NickTomlin avatar Mar 03 '16 15:03 NickTomlin

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.

cnishina avatar Mar 03 '16 20:03 cnishina

Any solution for above question?

poojagadekar89 avatar Sep 26 '17 10:09 poojagadekar89