我试图找到任何实际有效的 Selenium 教程。目前在看 这个 项目不编译。它有6个错误:
1) Firefox Driver cannot be resolved to a type
2) The import org.openqa cannot be resolved.
3) The import org.openqa cannot be resolved.
4) The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project.
5) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.
6) WebDriver cannot be resolved to a type.
我的类路径中有以下内容:
byte-buddy-1.7.5.jar,
client-combined-3.8.1-sources.jar,
client-combined-3.8.1.jar,
commons-codec-1.10.jar,
commons-exec-1.3.jar,
commons-logging-1.2.jar,
gson-2.8.2.jar,
guava-23.0.jar,
httpclient-4.5.3.jar,
httpcore-4.4.6.jar
请帮忙!
原文由 Steve Staple 发布,翻译遵循 CC BY-SA 4.0 许可协议
尝试将 selenium-java 依赖项添加到您的 POM.xml 例如:
它对我有用!