简体   繁体   English

IntelliJ IDEA 无法解析符号“openqa”

[英]IntelliJ IDEA cannot resolve symbol 'openqa'

Below are the import statements.下面是导入语句。

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;

Below are the dependencies added.下面是添加的依赖项。

<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 has successfully downloaded all the Selenium jars. Maven 已成功下载所有 Selenium jar。 Still the import statements show 'Cannot resolve symbol apache' and 'Cannot resolve symbol openqa' errors.导入语句仍然显示“无法解析符号 apache”和“无法解析符号 openqa”错误。

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

Then add them in intellij via File -> Project Structure -> Modules .然后通过File -> Project Structure -> Modules将它们添加到 intellij 中。

Click the Dependencies Tab.单击Dependencies选项卡。

Click the plus + .单击加号+

Add all the extracted jars from the zip you downloaded including those inside and outside the lib folder.添加从您下载的 zip 中提取的所有 jar,包括lib文件夹内部和外部的 jar。

Select them all and Apply .全部选择并Apply

在此处输入图片说明

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

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