Скачать Selenium не работает в Java + Spring Boot Project (Chrome 135, Selenium 4.31.0)JAVA

Программисты JAVA общаются здесь
Anonymous
Скачать Selenium не работает в Java + Spring Boot Project (Chrome 135, Selenium 4.31.0)

Сообщение Anonymous »

Я строю Java 21 + Spring Boot 3 Проект автоматизации, где я использую селен для автоматизации Chrome. Chrome Browser открывается правильно через Chromedriver, все работало месяц назад, но теперь загрузки файлов вообще не завершаются, файл .crdownload создается, но он никогда не завершается.
Я пытался обновить драйверы на мою версию Chrome, которая была автоматической обновлением
и настроил Chrome для тестирования, но не удачи. 21 < /p>
Spring Boot 3 < /p>
selenium version: 4.10 (также пробовали 4.31.0) < /p>
chrome версия: 135.0.7049.85 < /p>
chromedriver: 135.0.7049.84 (загруженная viebdraman < /pmedriver: 135.0.7049.84 (загруженная viebdraman < /pmedriver: 135.0.7049.84 < /p> < /p>. Класс < /p>
@configuration
public class webdriverconfig {< /p>
@Bean
public WebDriver webDriver() {
// Setup ChromeDriver
WebDriverManager.chromedriver().setup();

// Chrome Options
ChromeOptions options = new ChromeOptions();
options.setBinary("chrome/win64-135.0.7049.84/chrome-win64/chrome.exe");
options.addArguments("--start-maximized");
options.addArguments("--disable-notifications");
options.addArguments("--remote-allow-origins=*");
options.addArguments("--disable-gpu");
options.addArguments("--window-size=1920,1080");

WebDriver driver = new ChromeDriver(options);
System.out.println("✅ ChromeDriver started and should be visible now!");
return driver;
}
< /code>
} < /p>
console log: < /p>
2025-04-13T03:48:01.369+05:30 INFO 14204 --- [automate] [ main] c.t.automate.AutomateApplication : Starting AutomateApplication using Java 21.0.2 with PID 14204 (D:\Projects\JavaProjects\automate\target\classes started by Light in D:\Projects\JavaProjects\automate)
2025-04-13T03:48:01.376+05:30 INFO 14204 --- [automate] [ main] c.t.automate.AutomateApplication : No active profile set, falling back to 1 default profile: "default"
2025-04-13T03:48:02.454+05:30 INFO 14204 --- [automate] [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http)
2025-04-13T03:48:02.471+05:30 INFO 14204 --- [automate] [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2025-04-13T03:48:02.471+05:30 INFO 14204 --- [automate] [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-04-13T03:48:02.547+05:30 INFO 14204 --- [automate] [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2025-04-13T03:48:02.549+05:30 INFO 14204 --- [automate] [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1119 ms
2025-04-13T03:48:02.884+05:30 INFO 14204 --- [automate] [ main] i.g.bonigarcia.wdm.WebDriverManager : Using chromedriver 135.0.7049.84 (resolved driver for Chrome 135)
2025-04-13T03:48:02.903+05:30 INFO 14204 --- [automate] [ main] i.g.bonigarcia.wdm.WebDriverManager : Exporting webdriver.chrome.driver as C:\Users\Light\.cache\selenium\chromedriver\win64\135.0.7049.84\chromedriver.exe
2025-04-13T03:48:04.929+05:30 WARN 14204 --- [automate] [ main] o.o.selenium.devtools.CdpVersionFinder : Unable to find CDP implementation matching 135
2025-04-13T03:48:04.930+05:30 WARN 14204 --- [automate] [ main] o.o.selenium.chromium.ChromiumDriver : Unable to find version of CDP to use for 135.0.7049.84. You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.25.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
✅ ChromeDriver started and should be visible now!
2025-04-13T03:48:05.279+05:30 INFO 14204 --- [automate] [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path '/'
2025-04-13T03:48:05.288+05:30 INFO 14204 --- [automate] [ main] c.t.automate.AutomateApplication : Started AutomateApplication in 4.454 seconds (process running for 4.938)
< /code>
и pom.xml < /p>


org.seleniumhq.selenium
selenium-java
4.10.0




io.github.bonigarcia
webdrivermanager
5.5.0

< /code>
Я попробовал < /p>

Обновление зависимостей. < /li>
Обновление хромидривера и хрома < /li>
Добавление Devtools
не удачи, не уверен, как снять проблему < /li> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < /> < />>

Подробнее здесь: https://stackoverflow.com/questions/795 ... 35-seleniu

Вернуться в «JAVA»