testcontainers-java: 1.16.1 fails for Selenium 4.0.0 and Chrome browser
I am using Selenium 4.0.0 with Chrome as web browser. When I upgrade testcontainers to 1.16.1 I get the following error:
java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/String;)Lorg/openqa/selenium/chrome/ChromeOptions;
at org.testcontainers.containers.BrowserWebDriverContainer.configure(BrowserWebDriverContainer.java:173)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:322)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)
The error does not exist on 1.16.0.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 16 (12 by maintainers)
Commits related to this issue
- Option to fix #4593 in the context of #4609 — committed to testcontainers/testcontainers-java by GannaChernyshova 2 years ago
- install testcontainers from jitpack the method signature of `ChromeOptions#addArguments` has changed: https://github.com/testcontainers/testcontainers-java/issues/4593#issuecomment-950579053 until h... — committed to JKatzwinkel/tla-web by JKatzwinkel 2 years ago
I’ve tested #4609 and it works smoothly.
Thanks for reporting and investigating @derTobsch, we will look into this.
It is also broken with selenium < 4 and Firefox as browser, because since 1.16.1 the Chrome dependency is directly integrated and “ChromeOptions” is needed but not found.
see https://github.com/synyx/urlaubsverwaltung/runs/3978441190?check_suite_focus=true and the branch https://github.com/synyx/urlaubsverwaltung/tree/dependabot/maven/testcontainers.version-1.16.2
yes,
BrowserWebDriverContaineris currently broking with Chrome if users have Selenium version >= 4.0.0 on their classpath