selenium异常处理笔记

来源:互联网 发布:淘宝微任务 编辑:程序博客网 时间:2024/06/08 14:49

一、

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
at com.zx.test.Test.main(Test.java:20)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more


解决:除了selenium本身的jar包外,其目录下libs文件夹中的jar包也要引入。


二、

IE11的各种问题。


解决:看了各种解决办法,最终的结论是 IE11自身存在某些问题 导致无法很好的使用selenium,暂时无解决办法。


三、

浏览器和selenium版本的问题:selenium一律使用最新的。目前无法对最新版firefox进行支持。所以我退化到了40.0版本。测试可以使用。


四、

The method sendKeys(CharSequence...) from the type WebElement refers to the missing type CharSequenc

似乎是jdk1.8开始会出这个问题。将项目换成jdk1.7之后没问题。暂时不知道什么原因。暂时不去深究。挖坑待填

0 0
原创粉丝点击