对于我在 Selenium 中使用的几乎所有类,我收到类似“无法访问类型 org.openqa.selenium.chrome.ChromeDriver”的错误。
在我使用 Java 8 之前它工作得很好,但是当我升级到 Java 10 时,我收到了这样的错误。
请参阅下面的项目截图:
Edit 1:
Selenium-server jar file also contains all the webdriver code as well. See the below image. It has the ChromeDriver class in the same package which I have imported in the above class. The same combination is working fine If I am using either Java 8 (again see the below screenshot)or an older version of eclipse say neon.
为了避免此类错误,您应该通过配置构建路径将java编译器更改为早期版本1.7或1.7。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)