2009-09-25 3 views
3

안녕하세요. mvn -e integration-test을 실행할 때 기호를 찾을 수 없습니다. 오류가 발생합니다. 패키지가 내 저장소에있는 경우 왜 이런 일이 발생할 수 있습니까? 나는 그것을 다운로드하고 수동으로 설치하려고했지만 차이를 만들지 않습니다. 이것은 maven에서 일반적인 오류입니까? 내가 비스타 홈 에디션을 사용하고Symbol not found : Maven을 사용하여 Selenium을 실행할 때

,

오류 메시지

[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 셀레늄 \ 서버 \ \

답변

2

오류가 발생한 클래스 (org.openqa.selenium.server.SeleniumServer)는 이미 나열한 셀렌 - 서버 종속성에 정의되어 있습니다.

내가 볼 수있는 유일한 차이점은 자습서의 selenium-server 및 selenium-java-client-driver 버전이 0.9 버전에 있다는 것입니다. 소스를 보면 int를 취하는 생성자는 1.0.1 버전에서 삭제되었습니다.

튜토리얼의 목적을 위해 0.9 버전으로 롤백하는 것이 가장 간단 할 것입니다. 그리고 API에 익숙해지면 1.0.1 및 리 팩터로 다시 이동하십시오.

**main** 

public static void main(java.lang.String[] args) 
      throws java.lang.Exception 

Starts up the server on the specified port (or default if no port was specified) and then starts interactive mode if specified. 

Parameters: 
    args - - either "-port" followed by a number, or "-interactive" 
: 여기

포트 (생성자에 int 인수가) 이제 main 메소드에 명령 줄 인수로 전달 될 수 있음을 나타내는 1.0 version위한 JavaDoc합니다 ( 0.9 version와 비교)입니다
3

생성자와 같은 소리 SeleniumServer(int)은 종속 항목으로 나열한 버전 (1.0.1)에 더 이상 존재하지 않습니다.

내가 SeleniumServer 온라인 용 javadocs를 찾을 수 있다면 어떤 것을 사용할 지 제안 할 수 있습니다.

4

int (포트)을 매개 변수로 사용하는 생성자가 실제로 제거되었습니다 (변경 집합 : 2260 참조). 그래서 생성하기 위해 인수 없음의 생성자 SeleniumServer()를 사용하여 SeleniumServer (4444 어쨌든 기본 포트입니다) :

@BeforeSuite 
public void startSeleniumServer() throws Exception { 
    seleniumServer = new SeleniumServer(); 
    seleniumServer.start(); 
} 

아니면 구성 옵션을 통과해야하는 경우 SeleniumServer(RemoteControlConfiguration configuration)를 사용합니다.

관련 문제