使用webcollector时出现了如下异常

maven webcollector java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundException

 

分析是依赖的问题,不仅要添加selenium-java,还要添加htmlunit-driver的依赖,注意不要添加成selenium-htmlunit-driver

 1      <!-- selenium -->
 2         <dependency>
 3             <groupId>org.seleniumhq.selenium</groupId>
 4             <artifactId>selenium-java</artifactId>
 5             <version>${selenium.version}</version>
 6         </dependency>
 7         <dependency>
 8             <groupId>org.seleniumhq.selenium</groupId>
 9             <artifactId>htmlunit-driver</artifactId>
10             <version>${htmlunit-driver.version}</version>
11         </dependency> 

添加htmlunit-driver后,异常解决

 

相关文章:

  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-04-17
  • 2022-01-24
  • 2021-04-21
猜你喜欢
  • 2021-07-13
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-04-20
  • 2021-07-23
相关资源
相似解决方案