selenium遇到的问题记录

问题一:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function

解决方法:

这是因为包selenium解压后lib的包没有全部导入。把lib文件夹下的所有包都加到类库里,就好了。

 

问题二:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

引起这个错误的原因,是由于selenium的版本与当前安装的firefox的版本不兼容所致。 
去selenium的官网下载最新的包,和更新firefox就可以解决这个问题

 

 

问题三:

The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

loginname.sendKeys("ywx");

 

解决方法:在工程上点击右键选择Build Path -> Configure Build Path->Java Compiler,选择1.7版本。

posted on 2017-03-20 11:53  gracetest  阅读(181)  评论(0编辑  收藏  举报

导航