Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Sudden problem with Selenium Java version on Ubuntu Trusty #3102

Open chapulina opened 8 years ago

chapulina commented 8 years ago

At some point yesterday all our tests started failing because of the Java version:

[12:05:41] Starting 'wct:local'...
Installing and starting Selenium server for local browsers
----------
selenium-standalone installation starting
----------

---
selenium install:
from: https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar
to: /home/hugo/code/cloudsim/cloudsim-widgets/node_modules/selenium-standalone/.selenium/selenium-server/3.0.1-server.jar

---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.24/chromedriver_linux64.zip
to: /home/hugo/code/cloudsim/cloudsim-widgets/node_modules/selenium-standalone/.selenium/chromedriver/2.24-x64-chromedriver

---
firefox install:
from: https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz
to: /home/hugo/code/cloudsim/cloudsim-widgets/node_modules/selenium-standalone/.selenium/geckodriver/0.11.1-x64-geckodriver

---
File from https://chromedriver.storage.googleapis.com/2.24/chromedriver_linux64.zip has already been downloaded

---
File from https://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar has already been downloaded

---
File from https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz has already been downloaded

-----
selenium-standalone installation finished
-----
Exception in thread "main"
java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncherV3 : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:803)

    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

[12:05:43] 'wct:local' errored after 1.42 s
[12:05:43] Error: Selenium server did not start.Another Selenium process may already be running or your java version may be out of date.

On another computer, we upgraded the Java version to 8 and now the tests pass for Chrome 56, but there are new errors for Firefox 49. It would be great to go back to using an earlier Java version.

I'm not sure if the problem was caused by some change in wct or if it comes from upstream. Please close this issue if the problem wasn't introduced here, and in that case, it would be great if you could point me to whom I should be bugging instead.

Thanks!

chapulina commented 8 years ago

@ryantmer, thanks for referencing the issue. Adding "wct-local": "2.0.12" as a dev dependency also solves the issue for us - for chrome. Firefox 49 still doesn't work, but it used to.

pohhen commented 8 years ago

wct-local 2.0.12 also overrides the firefox driver version to 0.11.1 (if not overriden it will be 0.10.0) "selenium-overrides": { "drivers": { "firefox": { "version": "0.11.1"

leadegroot commented 8 years ago

+1 We're also seeing this and are looking for a fix. wct-local didn't fix it for us :(

bashmish commented 7 years ago

The same problem rises when you create a component with polymer CLI polymer init (element - A blank element template) and right after that run polymer test. (MacOS Sierra with java version "1.7.0_71", node v7.0.0, polymer-cli 0.17.0)

Looks like we really need configuration (#403) for selenium to have control over its installation and fixing its own problems not related to wct.

Update: upgrade to Java 8 fixed this problem, but Safari still doesn't work.

joaovieira commented 7 years ago

So, intrigued by the fact that the Google team can still work on the paper elements in their Travis CI server (e.g. https://travis-ci.org/PolymerElements/paper-input/jobs/172163606). I decided to replicate the environment in my Docker container:

And all works fine. But had the same error with the default Java 7.

screen shot 2016-11-09 at 17 10 48
hijazi commented 7 years ago

Thanks a lot that solved my problem!

tripleratamacue commented 7 years ago

@bashmish I used selenium-server-standalone-2.45.0.jar for safari, thats the most recent version that works for me, for others browsers, I can used latest, right now using selenium-server-standalone-3.0.1.jar, on java8, and just calling -Dwebdriver.chrome.driver in this order: java -jar -Dwebdriver.gecko.driver=geckodriver.exe selenium-server-standalone-3.0.0-beta2.jar

cherukumilli commented 6 years ago

@joaovieira - can you please post your Dockerfile? I am trying to create a Docker container for WCT and running into problems.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.