不能访问org.openqa.selenium.chrome.ChromeDriver类型 [英] The type org.openqa.selenium.chrome.ChromeDriver is not accessible

查看:1116
本文介绍了不能访问org.openqa.selenium.chrome.ChromeDriver类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Selenium中使用的几乎所有类都收到类似无法访问org.openqa.selenium.chrome.ChromeDriver类型"的错误.

I am getting the error like "The type org.openqa.selenium.chrome.ChromeDriver is not accessible" for almost all the classes I am using in Selenium.

在使用Java 8之前,它一直运行良好,但是当我升级到Java 10时,却出现了这样的错误.

It was working fine till I was using Java 8 but when I upgraded to Java 10 I am getting errors like this.

请参见以下项目的屏幕截图:

See the screenshot of the project below:

Selenium服务器的jar文件也包含所有的webdriver代码.参见下图.它在我在上面的类中导入的同一包中具有ChromeDriver类.如果我使用的是Java 8(再次参见下面的屏幕截图)或旧版本的eclipse,请使用相同的组合正常工作,例如neon.

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.

To avoid such error, You should change java compiler to early version 1.7 or 1.7 from configuring build path.

这篇关于不能访问org.openqa.selenium.chrome.ChromeDriver类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆