“无法解析导入单位"带有硒独立服务器3.9.1的Eclipse Photon中的导入错误 [英] "The import org cannot be resolved" error with the imports in Eclipse Photon with selenium Standalone server 3.9.1

查看:150
本文介绍了“无法解析导入单位"带有硒独立服务器3.9.1的Eclipse Photon中的导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过添加硒罐和相关罐创建基本的硒Webdriver程序,下面是我的代码.但是当我尝试解析firefordriver和webdriver导入它们.即时通讯收到导入组织无法解决"错误.

I'm creating a basic selenium Webdriver program by adding the selenium jars and relative jars, below is my code. but when i try to resolve firefordriver and webdriver for importing them. im getting "The import org cannot be resolved" error.

环境详细信息:

JavaSe-10.

JavaSe-10.

Eclipse版本Photon发行版(4.8.0)Build ID:20180619-1200

Eclipse Version Photon Release (4.8.0) Build id: 20180619-1200

Selenium StandAlone服务器3.9.1

Selenium StandAlone server 3.9.1

代码:

package selenium;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class WebDriverBasics {

    public static void main(String[] args) {

        //1. Firefox browser. 
        //geckodriver.
        System.setProperty("webdriver.gecko.driver","d:\\installations\\eclipse\\jars\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
    }
}

推荐答案

删除module-info.java文件或在创建项目时创建的任何其他模块文件.这样可以解决问题.

delete module-info.java file or any other module file that was created at the time of creating the project. That will resolve the issue.

这篇关于“无法解析导入单位"带有硒独立服务器3.9.1的Eclipse Photon中的导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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