嗨,我在運行mvn -e integration-test
時收到了一個找不到符號的錯誤。爲什麼會發生這種情況,如果該軟件包在我的存儲庫?我曾嘗試下載並手動安裝,但它沒有什麼區別。這是maven常見錯誤嗎?找不到符號:用maven運行selenium時
我使用的是Vista家庭版,
錯誤消息
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
D:\MyWorks\steps\step6\functest\src\it\com\mycompany\app\functest\FirstTest.java:[22,25] cannot find symbol
symbol : constructor SeleniumServer(int)
location: class org.openqa.selenium.server.SeleniumServer
教程中使用。 http://binil.wordpress.com/2006/12/08/automated-smoke-tests-with-selenium-cargo-testng-and-maven/
POM
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>myapp</artifactId>
<groupId>com.mycompany</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>functest</artifactId>
<name>functional-tests</name>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openqa.selenium.server</groupId>
<artifactId>selenium-server</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.1</version>
<scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/it</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/it/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
PATH硒我的機器上的服務器類。一切都在那裏,我檢查。
.m2目錄\庫\組織\ openqa \硒\服務器\硒 - 服務器\ 1.0.1 \硒服務器1.0.1.jar \組織\ openqa \硒\服務器\