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

Posted code never lies

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven webcollector java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundExcep相关的知识,希望对你有一定的参考价值。

使用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后,异常解决

 

以上是关于maven webcollector java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundExcep的主要内容,如果未能解决你的问题,请参考以下文章