Selenium webdriver 常见问题

  1. 出现java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
    是因为缺少 xml jar ,如果使用的是maven 可以依赖
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>

或者可以自己下载,之后BuildPath
下载地址:http://mvnrepository.com/artifact/xml-apis/xml-apis/1.4.01

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

这是因为Firefox 版本与selenium的版本不对应,升级Selenium版本,或者降低Firefox的版本

事在人为,功不唐捐
原文地址:https://www.cnblogs.com/xinleishare/p/4570137.html