Closed ixiaofu closed 9 months ago
@ixiaofu, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
Hi, @ixiaofu. Please follow the issue template, we need more information to reproduce the issue.
Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.
Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.
Reply to this issue when all information is provided, thank you.
package com.xxx;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.v120.network.Network;
class Test {
private WebDriver chromeDriver;
private DevTools chromeDevTools;
private WebDriver getDriver() {
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
return driver;
}
private boolean initDriver() {
if (this.chromeDriver == null) {
this.chromeDriver = getDriver();
}
if (this.chromeDevTools == null) {
this.chromeDevTools = ((ChromeDriver) this.chromeDriver).getDevTools();
this.chromeDevTools.createSession();
this.chromeDevTools.send(Network.enable(Optional.empty(), Optional.empty(), Optional.empty()));
}
return this.chromeDriver != null && this.chromeDevTools != null;
}
public Test() {
initDriver();
}
}
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.1'
id 'io.spring.dependency-management' version '1.1.4'
}
group = 'com.xxxxx'
version = '1.0.0'
java {
sourceCompatibility = '17'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.seleniumhq.selenium:selenium-java:4.16.1'
}
tasks.named('test') {
useJUnitPlatform()
}
java.lang.NoSuchMethodError: 'java.util.function.Function org.openqa.selenium.devtools.ConverterFunctions.map(java.lang.String, java.util.function.Function)'
at org.openqa.selenium.devtools.v120.target.Target.getTargets(Target.java:153) ~[selenium-devtools-v120-4.16.1.jar:na]
at org.openqa.selenium.devtools.v120.v120Target.getTargets(v120Target.java:55) ~[selenium-devtools-v120-4.16.1.jar:na]
at org.openqa.selenium.devtools.DevTools.findTarget(DevTools.java:171) ~[selenium-remote-driver-4.14.1.jar:na]
at org.openqa.selenium.devtools.DevTools.createSession(DevTools.java:131) ~[selenium-remote-driver-4.14.1.jar:na]
at org.openqa.selenium.devtools.DevTools.createSession(DevTools.java:117) ~[selenium-remote-driver-4.14.1.jar:na]
There are mixed versions (4.14.1 and 4.16.1) on your classpath, this is the reason for the failure.
java.lang.NoSuchMethodError: 'java.util.function.Function org.openqa.selenium.devtools.ConverterFunctions.map(java.lang.String, java.util.function.Function)' at org.openqa.selenium.devtools.v120.target.Target.getTargets(Target.java:153) ~[selenium-devtools-v120-4.16.1.jar:na] at org.openqa.selenium.devtools.v120.v120Target.getTargets(v120Target.java:55) ~[selenium-devtools-v120-4.16.1.jar:na] at org.openqa.selenium.devtools.DevTools.findTarget(DevTools.java:171) ~[selenium-remote-driver-4.14.1.jar:na] at org.openqa.selenium.devtools.DevTools.createSession(DevTools.java:131) ~[selenium-remote-driver-4.14.1.jar:na] at org.openqa.selenium.devtools.DevTools.createSession(DevTools.java:117) ~[selenium-remote-driver-4.14.1.jar:na]
There are mixed versions (4.14.1 and 4.16.1) on your classpath, this is the reason for the failure.
Thank you very much. After investigation, it was found that after importing Springboot into the project, the Selenium version was automatically downgraded under Gradle management.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
What happened?
In Java17, using selenium devtools, it was found that the input.readArray method does not exist.
How can we reproduce the issue?
Relevant log output
Operating System
MacOS 14.0
Selenium version
4.16.1
What are the browser(s) and version(s) where you see this issue?
Google Chrome 120.0.6099.216 arm
What are the browser driver(s) and version(s) where you see this issue?
selenium-chrome-driver-4.14.1.jar
Are you using Selenium Grid?
No response