Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

java.io.IOException: Error writing to server #39

Open
ibmalan opened this issue Jan 17, 2018 · 24 comments
Open

java.io.IOException: Error writing to server #39

ibmalan opened this issue Jan 17, 2018 · 24 comments

Comments

@ibmalan
Copy link

ibmalan commented Jan 17, 2018

when running script, it failed and report error:
[chrome #0-0] java.io.IOException: Error writing to server
[chrome #0-0] Error: An unknown server-side error occurred while processing the command.
[chrome #0-0] at Object.module.exports [as checkContainsText] (test/utils/check/checkContainsText.js:19:16)
[chrome #0-0] at World. (test/steps/dns.js:50:15)
[chrome #0-0] at Promise.F (node_modules/core-js/library/modules/_export.js:35:28)
[chrome #0-0] at elementIdText("0.7884895451383356-31") - getText.js:35:50

"dependencies": {
"babel-preset-es2015": "~6.24.0",
"babel-register": "~6.24.0",
"chai": "~3.5.0",
"cucumber": "^1.3.1",
"gulp": "^3.9.1",
"minimist": "^1.2.0",
"eslint-plugin-webdriverio": "^1.0.1",
"wdio-cucumber-framework": "~0.3.1",
"wdio-cucumber-reporter": "0.0.2",
"wdio-firefox-profile-service": "0.0.3",
"wdio-junit-reporter": "^0.3.0",
"wdio-sauce-service": "^0.4.0",
"wdio-selenium-standalone-service": "0.0.9",
"wdio-spec-reporter": "~0.1.0",
"webdriverio": "~4.8.0"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-eslint": "^7.1.0",
"babel-jest": "^20.0.3",
"babel-loader": "^6.2.7",
"babel-plugin-istanbul": "^4.1.1",
"babel-preset-react": "^6.16.0",
"babel-polyfill": "~6.23.0",
"eslint": "~3.19.0",
"eslint-config-airbnb-base": "~11.1.0",
"eslint-plugin-import": "~2.2.0"
}

wdid.con.js
services: ['selenium-standalone'],

@ibmalan
Copy link
Author

ibmalan commented Jan 17, 2018

Anyone encountered such error?

@weymanf
Copy link

weymanf commented Mar 9, 2018

We are also having this issue. Did you ever find the solution?

@sshaar08
Copy link

me too:

java.io.IOException: Error writing to server
running chrome
Error: An unknown server-side error occurred while processing the command.
at elementIdAttribute("0.8191366131709059-5", "disabled") - getAttribute.js:43:55

@phil-lgr
Copy link

phil-lgr commented Apr 4, 2018

Surprise, seems to be a MacOS only problem! I run the exact same code on Windows 10 and it works fine!

image

image

@cuff-links
Copy link

Does anyone know why this might not fail on SauceLabs? I run the same tests on sauce and on Mac and they all pass. When I run it locally on Mac, it fails.

@phil-lgr
Copy link

phil-lgr commented Apr 6, 2018

I put together a sample repo: https://github.com/phil-lgr/wdio-issue-repro

@cuff-links
Copy link

@phil-lgr For the time being, I downgraded wdio to use selenium 3.4. This isn't ideal as it makes me have to use older versions of the browser. Seems like you have a good understanding of what's going on. Are you working on a fix?

@phil-lgr
Copy link

phil-lgr commented Apr 9, 2018

I don't... I wish selenium was written in JavaScript 🤣

@christian-bromann
Copy link
Contributor

@silne30 WebdriverIO doesn't run any Selenium. What you referring to is the Selenium standalone server which only starts the driver. You need to set up the proper configs to download the correct driver version.

@phil-lgr same here .. the standalone server is written in Java because when Selenium started Node.js wasn't at the level it is now. Also it would not bring any advantage to have it be written in JavaScript.

@phil-lgr
Copy link

phil-lgr commented Apr 9, 2018

Yes I mean the standalone server.. like when you have error coming from selenium or the drivers, e.g.

running chrome
Error: An unknown server-side error occurred while processing the command.
at elementIdAttribute("0.8191366131709059-5", "disabled") - getAttribute.js:43:55

It's hard to know what's going on..

@kathar1223
Copy link

i am also facing the same issue,

java.io.IOException: Error writing to server
running chrome
Error: An unknown server-side error occurred while processing the command.
    at elementIdAttribute("0.3035431964261228-14", "id") - getAttribute.js:43:55

@ibmalan found any solution?

@kathar1223
Copy link

@phil-lgr any solution found??

@phil-lgr
Copy link

phil-lgr commented May 1, 2018

Hi, yes, make sure you put

version: '3.4.0',

in your seleniumArgs and seleniumInstallArgs

@phil-lgr
Copy link

phil-lgr commented May 1, 2018

I had problems on MacOS with higher versions

@kathar1223
Copy link

@phil-lgr
I am nowhere using seleniumArgs and seleniumInstallArgs in my project

"dependencies": {
    "allure-commandline": "^2.5.0",
    "animate": "^1.0.0",
    "assert": "^1.4.1",
    "babel-preset-env": "^1.6.0",
    "babel-register": "^6.26.0",
    "chai": "^4.1.2",
    "chai-as-promised": "^7.1.1",
    "cucumber": "^3.0.0",
    "graceful-fs": "^4.1.4",
    "grunt": "^0.4.5",
    "grunt-webdriver": "^1.0.0",
    "jquery": "^3.3.1",
    "junit-viewer": "^4.11.1",
    "lodash": "^4.17.4",
    "node-excel-to-json": "0.0.3",
    "underscore": "^1.8.3",
    "wdio-allure-reporter": "^0.6.0",
    "wdio-dot-reporter": "0.0.5",
    "wdio-json-reporter": "^0.1.1",
    "wdio-junit-reporter": "0.0.2",
    "wdio-spec-reporter": "^0.1.2",
    "webdriverio": "^4.12.0"
  },
  "devDependencies": {
    "drag-mock": "^1.4.0",
    "eslint": "^1.10.3",
    "eslint-config-standard": "^10.2.1",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.1.1",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-react": "^3.16.1",
    "eslint-plugin-standard": "^3.0.1",
    "grunt-cli": "^0.1.13",
    "grunt-cucumberjs": "^0.8.7",
    "node-uuid": "^1.4.7",
    "selenium-standalone": "^6.8.0",
    "wdio-browserstack-service": "^0.1.4",
    "wdio-cucumber-framework": "^1.0.2",
    "wdio-phantomjs-service": "^0.2.2",
    "wdio-sauce-service": "^0.2.2",
    "wdio-screenshot": "^0.5.0",
    "wdio-selenium-standalone-service": "0.0.9"
  },

@cuff-links
Copy link

@kathar1223 Selenium Args go in your configuration file.

exports.config = {
  seleniumInstallArgs: { version: '3.4.0' },
  seleniumArgs: { version: '3.4.0' },
  specs: [
    './test/spec/**/*spec.js'
  ],
  ...
}

@cuff-links
Copy link

@kathar1223 This will, however, affect the versions of the browsers you can test against as newer versions of the browser will return an error about being invalid (because they weren't out yet when that Selenium 3.4.0 was out). Hope that doesn't affect your use case.

@ibmalan
Copy link
Author

ibmalan commented May 10, 2018

I remember the issue had been solved by using a higher webdriverio version. please try it!
"webdriverio": "~4.9.9"

@tomchin23
Copy link

tomchin23 commented May 10, 2018

I too have this same problem

java.net.ConnectException: Connection refused: connect
Error: An unknown server-side error occurred while processing the command.
at elementIdAttribute("0.6685341428533327-41", "href") - getAttribute.js:43:55

@ibmalan , I am using the latest version of webdriverio, and still get the same error.

"selenium-standalone": "^6.14.0",
"webdriverio": "^4.12.0",

@ibmalan
Copy link
Author

ibmalan commented May 11, 2018

@tomchin23 Maybe you can downgrade webdriverio to 4.9.9 and try again?

@cuff-links
Copy link

@tomchin23 Did this solve your problem? Having the same issue@ Did @ibmalan's suggestion work?

@christian-bromann
Copy link
Contributor

This will be most likely fixed in v5

@tomchin23
Copy link

@silne30 This was a while ago, but no I did not end up keeping a downgrade because something else started not working. As you mentioned above, working with older browser versions is not ideal.

@ashwinvellore
Copy link

What is the fix to the error "java.io.IOException: Error writing to server". Is it related to the error "java.net.SocketException: Connection reset by peer (connect failed)".

How to solve the issue " java.net.SocketException: Connection reset by peer (connect failed)". I am seeing this error for few of my test cases. Other test cases run fine. Here is my configuration:
"wdio-cucumber-framework": "^0.2.17",
"wdio-selenium-standalone-service": "0.0.12",
"webdriverio": "^4.14.4"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants