0

I use Java+selenium+testng+maven. And I tried to use WebDriver Manager instead of standard usage. After declaration according to the instruction of API, I ran into a problem. When compiling the errors occur:

java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.copyInputStreamToFile(Ljava/io/InputStream;Ljava/io/File;)V

at io.github.bonigarcia.wdm.Downloader.download(Downloader.java:128)
at io.github.bonigarcia.wdm.BrowserManager.manage(BrowserManager.java:277)
Giri B
  • 9
  • 1
  • commons-io commons-io 2.11.0 io.github.bonigarcia webdrivermanager 5.4.0 – Giri B Jul 19 '23 at 11:20
  • have you tried to rebuild maven or try to use lower version, like io.github.bonigarcia webdrivermanager 5.3.2 – Yaroslavm Jul 19 '23 at 11:23
  • You need to provide more code to allow people to help you. Not just the error. – BernardV Jul 19 '23 at 11:24
  • Refer this if it helps - https://stackoverflow.com/a/76719443/7598774 – Shawn Jul 19 '23 at 11:24
  • public void setup(String br) { logger = Logger.getLogger("CCMTAutomation"); PropertyConfigurator.configure("log4j.properties"); try { if (br.equalsIgnoreCase("chrome")) { setupChrome(); } else { throw new IllegalArgumentException("Invalid browser parameter: " + br); } } catch (Exception e) { // Handle and report the exception e.printStackTrace(); Assert.fail("Error setting up WebDriver: " + e.getMessage()); } } – Giri B Jul 19 '23 at 13:28
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 19 '23 at 23:39

0 Answers0