0
私はIDEとしてIntellijを使用し、パッケージマネージャとしてmavenを使用してjavaを使用してセレンテストを学習しています。次のようにIntellij IDEAのシンボルエラーを解決することができません
私のpom.xmlがある:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>depositTest</groupId>
<artifactId>deposittest</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
</dependencies>
</project>
次のように私のimport文は次のとおりです。
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.testng.annotations.AfterTest;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.By;
import static org.junit.Assert.*;
import static org.testng.AssertJUnit.assertEquals;
import org.openqa.selenium.WebDriver;
しかし、私はIDEでTestNGのとJUnitライブラリをcan not resolve symbol errors
を取得します。私は間違って何をしていますか?
Mavenサイドバーで[インポート]オプションを試しましたか? –
自動的にインポートし、何度も再インポートするように設定します。 –
http://stackoverflow.com/a/42427510/104891を参照してください。それがIntelliJ IDEAの外部のコマンドラインから動作することを確認してください。 – CrazyCoder