serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

NoClassDefFoundError: org/openqa/selenium/support/ui/Clock #189

Open dejj opened 5 years ago

dejj commented 5 years ago

Features in my automation project just started failing after the indirect dependency to selenium-api upgraded from 3.14 to 3.141.59 in which Selenium removed the deprecated class Clock (see: https://github.com/SeleniumHQ/selenium/commit/59b5002ce4ffd727f96645086dcad300c43504b8#diff-efc641281c9880d5cf47370a2b7b0d66). Error as follows:

Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/support/ui/Clock
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
  at java.lang.Class.privateGetPublicMethods(Class.java:2902)
  at java.lang.Class.getMethods(Class.java:1615)
  at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:38)
  at cucumber.runtime.java.JavaBackend.loadGlue(JavaBackend.java:79)
  at cucumber.runner.Runner.<init>(Runner.java:45)
  at cucumber.runtime.Runtime.<init>(Runtime.java:65)
  at cucumber.runtime.Runtime.<init>(Runtime.java:45)
  at cucumber.runtime.Runtime.<init>(Runtime.java:41)
  at cucumber.api.cli.Main.run(Main.java:35)
  at cucumber.api.cli.Main.main(Main.java:18)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.support.ui.Clock
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 12 more

Process finished with exit code 1

Does Serenity still refer to Selenium's org.openqa.selenium.support.ui.Clock class?

wakaleo commented 5 years ago

What version of Serenity?

dejj commented 5 years ago

Excellent question. I'm sorry I forgot to check this. I used to have:

Everything works again after updating to:

Though the changelogs only mention 2.0.5 and 1.1.9. (Doesn't work with those)

What should I use as the authoritative source for setting my version numbers?

wakaleo commented 5 years ago

The versions of Serenity and Selenium need to be in sync: the starter projects (https://github.com/serenity-bdd/serenity-cucumber-starter) are usually the most up to date source.