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

使用webcollector时出现了如下异常

 

分析是依赖的问题,不仅要添加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后,异常解决

 

posted @ 2018-08-05 17:22  tele  阅读(2300)  评论(0)    收藏  举报