【问题标题】:IntelliJ IDEA cannot resolve symbol 'openqa'IntelliJ IDEA 无法解析符号“openqa”
【发布时间】:2019-02-21 08:00:36
【问题描述】:

以下是导入语句。

import org.apache.commons.lang3.StringUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;

以下是添加的依赖项。

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

Maven 已成功下载所有 Selenium jar。导入语句仍然显示“无法解析符号 apache”和“无法解析符号 openqa”错误。

【问题讨论】:

  • 您是否尝试过清理和更新项目?
  • @steven35:是的。
  • 这些dependency 元素是在你的pom 中的dependencies 元素还是dependencyManagement 元素中?只是为了确保...
  • 你检查过普通命令行吗?
  • 结果是?作品等没有任何错误?

标签: java maven selenium intellij-idea


【解决方案1】:

在此处下载 jar 文件:https://www.selenium.dev/downloads/

然后通过File -> Project Structure -> Modules将它们添加到intellij。

单击Dependencies 标签。

点击加号+

从您下载的 zip 中添加所有提取的 jar,包括 lib 文件夹内外的那些。

全选并Apply

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多