简体   繁体   English

Java selenium“无法解析导入组织”

[英]Java selenium " The import org cannot be resolved"

I have deleted the earlier version of eclipse I was using also updated the selenium 3.0.1, also added all the .jar files but now I'm getting a new error.我已经删除了我正在使用的早期版本的 eclipse,还更新了 selenium 3.0.1,还添加了所有 .jar 文件,但现在我收到了一个新错误。

"The import org cannot be resolved" “无法解析导入组织”

Below is the code:下面是代码:

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class findByLinkedText {

  public static void main(String[] args) {
    System.setProperty("Webdriver.gecho.driver",
      "C:\\Users\\lsharma1\\Desktop\\Selenium Drivers\\Gecho 
      driver\\ gechodriver.exe ");
      WebDriver driver = new FirefoxDriver();

      drive.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); String URL = "https://www.google.co.in/"; driver.get(URL); driver.close();

    }

  }

use this maven dependency in your pom :在你的 pom 中使用这个 maven 依赖:

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.3.1</version>
        </dependency>

It is not recognizing this org package.它无法识别此组织包。
Hope that helps you.希望能帮到你。

May be the problem is that your selenium dependency has not been downloaded in your users/usename/.m2 folder.可能的问题是您的 selenium 依赖项尚未下载到您的 users/usename/.m2 文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM