Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I updated the selenium web driver and suddenly one test is failing. #2262

Closed
abhikhatri opened this issue Aug 30, 2017 · 18 comments
Closed

I updated the selenium web driver and suddenly one test is failing. #2262

abhikhatri opened this issue Aug 30, 2017 · 18 comments

Comments

@abhikhatri
Copy link

Last night I updated selenium standalone on my machine and ran tests after it. Now it's throwing following error and I'm not sure what causing it. When I run wdio.

java.net.SocketException: Connection reset by peer (connect failed) running chrome Error: An unknown server-side error occurred while processing the command. at Context.<anonymous> (test/specs/stats-mode.js:166:36) at Promise.F (node_modules/core-js/library/modules/_export.js:35:28) at elementIdText("0.3745145050332137-10") - getText.js:

@erwinheitzman
Copy link
Member

I believe this is an issue that lies with Selenium 3.5+, a simple workaround is to add the following to your wdio.conf.js file.

seleniumInstallArgs: { version: '3.4.0' },
seleniumArgs: { version: '3.4.0' },

This will install a working version of Selenium and all your other packages can be updated as well. This is how I worked around the issue myself and I am running the latest drivers and all which work fine with Selenium 3.4.0.

@abhikhatri
Copy link
Author

Thanks man! Worked like a charm.

@kontrollanten
Copy link

Thanks @erwinheitzman ! Is there any issue at Selenium regarding this? Do you know when it can be fixed so we can use latest Selenium with WebdriverIO?

@erwinheitzman
Copy link
Member

erwinheitzman commented Sep 8, 2017

@kontrollanten I have not been able to figure out what the exact issue is so for now I roll with 3.4, it doesn't really hurt ;)

@YmerejRedienhcs
Copy link

@erwinheitzman I'm confused about how to get the correct version (3.4) of selenium installed. I did add the following lines to my wdio.all.conf.js, but as far as I can tell, that didn't change what selenium got used -- I still get the error.

exports.config = {
  // see: https://github.com/webdriverio/webdriverio/issues/2262
  seleniumInstallArgs: { version: '3.4.0' },
  seleniumArgs: { version: '3.4.0' },
...

Here's what my run looks like:

JSchneiderMbpR2-1088:opendata-integration-tests jere7054$ HEADLESS=false NODE_ENV=qa npm run wip -- --spec src/features/opendataAdminCreateHubOrgSite.feature

> opendata-integration-tests@1.2.0 wip /Users/jere7054/tmp/allnewdeletemewhendone/opendata-ui/tests/opendata-integration-tests
> wdio wdio.wip.conf.js "--spec" "src/features/opendataAdminCreateHubOrgSite.feature"

pattern ./src/features/**/*SKIPME.feature did not match any file
e2e: 9/12/2017, 4:56:43 PM opendataAdminCreateHubOrgSite.feature
[16:57:02]  	Saved screenshot: ERROR_chrome_2017-09-12T20-57-01.493Z.png
------------------------------------------------------------------
[chrome #0-0] Session ID: 43b1e06e8cd4348433869181edb12a3a
[chrome #0-0] Spec: /Users/jere7054/tmp/allnewdeletemewhendone/opendata-ui/tests/opendata-integration-tests/src/features/opendataAdminCreateHubOrgSite.feature
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0] Create and visit hub-org site
[chrome #0-0]
[chrome #0-0]     I can create and visit a site
[chrome #0-0]       ✓ I put a timestamp with message "opendataAdminCreateHubOrgSite.feature"
[chrome #0-0]       ✓ I open the site "/"
[chrome #0-0]       ✓ I sign in with hub credentials
[chrome #0-0]       ✓ I click on the element "opendataHomePage.userDropdown"
[chrome #0-0]       ✓ I wait on element "opendataHomePage.signedInUser" for 10000ms to exist
[chrome #0-0]       ✓ I wait on element "opendataHomePage.signedInUser" for 10000ms to contain a value
[chrome #0-0]       ✓ I expect that element "opendataHomePage.signedInUser" contains the text "genericPage.opendataDcAdminUsername"
[chrome #0-0]       ✓ I click on the element "opendataHomePage.userDropdown"
[chrome #0-0]       ✓ I wait on element "opendataHomePage.modalBackdrop" for 10000ms to not be visible
[chrome #0-0]       ✓ I wait on element "opendataHomePage.userDropdown" for 10000ms to be visible and click on it
[chrome #0-0]       ✓ I wait on element "opendataHomePage.userDropdownAdminOption" for 10000ms to be visible and click on it
[chrome #0-0]       ✓ I wait on element "opendataAdminPage.sitesLink" for 10000ms to be visible and click on it
[chrome #0-0]       ✓ I wait on element "opendataSiteListPage.siteListCreateNewSiteButton" for 15000ms to be visible and click on it
[chrome #0-0]       ✓ I supply a title and url for the hub site
[chrome #0-0]       1) I click on the element "opendataAdminPage.siteCreateNext"
[chrome #0-0]       - I add a group to the hub site
[chrome #0-0]       - the hub site is visitable within 10000ms
[chrome #0-0]       - I verify the org is a hub org
[chrome #0-0]       - I delete the hub site
[chrome #0-0]       - the hub site is nonvisitable within 10000ms
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 14 passing (22s)
[chrome #0-0] 5 pending
[chrome #0-0] 1 failing
[chrome #0-0]
[chrome #0-0] 1) I can create and visit a site13 I click on the element "opendataAdminPage.siteCreateNext":
[chrome #0-0] unknown error: Element is not clickable at point (99, 1221)
[chrome #0-0] Error: An unknown server-side error occurred while processing the command.
[chrome #0-0]     at World.module.exports (src/support/action/clickElement.js:31:3)
[chrome #0-0]     at Promise.F (node_modules/core-js/library/modules/_export.js:35:28)
[chrome #0-0]     at elementIdClick("0.21313816112978556-5") - click.js:20:22
[chrome #0-0]

Wrote xunit report to [./reports].


14 passing (24.70s)
5 skipped
1 failing

1) I can create and visit a site13 I click on the element "opendataAdminPage.siteCreateNext":
unknown error: Element is not clickable at point (99, 1221)
running chrome
Error: An unknown server-side error occurred while processing the command.
    at World.module.exports (src/support/action/clickElement.js:31:3)
    at Promise.F (node_modules/core-js/library/modules/_export.js:35:28)
    at elementIdClick("0.21313816112978556-5") - click.js:20:22


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opendata-integration-tests@1.2.0 wip: `wdio wdio.wip.conf.js "--spec" "src/features/opendataAdminCreateHubOrgSite.feature"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opendata-integration-tests@1.2.0 wip script 'wdio wdio.wip.conf.js "--spec" "src/features/opendataAdminCreateHubOrgSite.feature"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the opendata-integration-tests package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     wdio wdio.wip.conf.js "--spec" "src/features/opendataAdminCreateHubOrgSite.feature"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs opendata-integration-tests
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls opendata-integration-tests
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jere7054/.npm/_logs/2017-09-12T20_57_02_982Z-debug.log
JSchneiderMbpR2-1088:opendata-integration-tests jere7054$ !v
vi wdio.all.conf.js
JSchneiderMbpR2-1088:opendata-integration-tests jere7054$

I did a fresh npm install.

I'm kind of a noob to the whole node environment, so I must be missing some assumption.

@YmerejRedienhcs
Copy link

OK, I see what's going on. When I run wdio, it starts selenium-standalone-service, and when it starts the first time, it grabs the selenium version specified (if it is specified) in seleniumInstallArgs: { version: '3.4.0' }, seleniumArgs: { version: '3.4.0' }, in wdio.conf.js. In order to effect and observe that change, I had to remove selenium-standalone-service from node_modules first, and then npm install selenium-standalone-service. To top it off, ha! that wasn't even my problem. But at least I understand a little more now.

@erwinheitzman
Copy link
Member

@YmerejRedienhcs That's it indeed, the wdio-selenium-standalone-service installs selenium-standalone (the npm package), which then installs Selenium itself.
Running the npm install installs the wdio-selenium-standalone-service and selenium-standalone packages but since Selenium isn't part of this it get's installed the first time you run Webdriverio.

The folder that contains the Selenium version + the webdrivers is found in your node_modules folder: node_modules > selenium-standalone > .selenium
If you remove the .selenium folder and then run Webdriverio it will recreate that folder and install the latest required drivers and the latest (or specified) Selenium version.

Hope this helps anyone else running into the same problem :)

@toien44
Copy link

toien44 commented Nov 20, 2017

This is still not fixed in 3.5.2. I will have to downgrade to 3.4 and revert chromedrivers too and all versions of chrome on all machines?

@erwinheitzman
Copy link
Member

erwinheitzman commented Nov 20, 2017

@toien44 before saying it's still not fixed you should know that Selenium is already at version 3.7.1.
I haven't tested if this is fixed or not but it's worth a shot to check it out.
I personally am still on 3.4 and as long as that is working I do not see the problem.
You are able to update your browsers, drivers and other packages etc so there's nothing holding you back.
PS: what I am trying to say is that downgrading to 3.4 does not mean that you have to revert your chromedrivers and all versions of Chrome. They can stay as they are you only have to do as described above.

@toien44
Copy link

toien44 commented Nov 21, 2017

Thanks for the info. Do you know what the selenium issue was? Why was the error happening? I also downgraded to 3.4.0 and got the same issue still. I'm trying 3.7.1 now.

@toien44
Copy link

toien44 commented Nov 21, 2017

I've tried 3.4.0, 3.5.2, 3.6.0, 3.7.1 and non for them work. Getting the same error

java.net.SocketException: Connection reset by peer
  Error: An unknown server-side error occurred while processing the command.
      at elementIdDisplayed("0.14703088915361828-3") - isVisible.js:71:55

@patthiel
Copy link
Contributor

@christian-bromann We attempted upgrading selenium recently and ran into this as well. Doing some digging, it seems like this is a webdriverIO issue.

Do we have any issue/work to track fixing this in the wdio project (other than this issue) and an idea of the changes that are needed? I saw your note about throttling requests in here, is that work already complete?

@christian-bromann
Copy link
Member

I saw your note about throttling requests in here, is that work already complete?

Nope, feel free to propose a PR

@patthiel
Copy link
Contributor

patthiel commented Dec 20, 2017

@christian-bromann this is the issue related to throttling/queueing requests you referenced in the selenium issue thread. Will continue discussion of the changes needed there.

@basickarl
Copy link

Tried in the wdio.conf.js file, still not working:

exports.config = {
    // see: https://github.com/webdriverio/webdriverio/issues/2262
    seleniumInstallArgs: { version: '3.4.0' },
    seleniumArgs: { version: '3.4.0' },
};

Still getting Error: java.net.SocketException: Connection reset by peer (connect failed).

@kapilchokhawala
Copy link

@erwinheitzman seleniumInstallArgs and seleniumArgs worked like a charm. Thanks a lot.

@xcao-riffyn
Copy link

@erwinheitzman Thank you a ton! It works like a super charm! I didn't google to come to this after whole AM banging my head against the wall tried to figure it out but couldn't until found this. Want to add after you modify your wdio.config.js to include selenium server version, you need to wipe out the node_modules folder to delete the current later version using 'rm -rf node_modules' then do 'npm install'. then when you run wdio it would use the version you specified in the wdio.config.js

@MichelLalmohamed
Copy link

@YmerejRedienhcs That's it indeed, the wdio-selenium-standalone-service installs selenium-standalone (the npm package), which then installs Selenium itself.
Running the npm install installs the wdio-selenium-standalone-service and selenium-standalone packages but since Selenium isn't part of this it get's installed the first time you run Webdriverio.

The folder that contains the Selenium version + the webdrivers is found in your node_modules folder: node_modules > selenium-standalone > .selenium
If you remove the .selenium folder and then run Webdriverio it will recreate that folder and install the latest required drivers and the latest (or specified) Selenium version.

Hope this helps anyone else running into the same problem :)

Thank you for the explaining the install order!

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

No branches or pull requests