2011-06-15 129 views
0

無論我使用的硒2.xx的版本,網絡驅動器,我會得到相同的編譯錯誤硒2.0 webdriver的測試編譯錯誤

:錯誤讀取C:\ Documents和 設置\ kondojis.m2 \庫\組織\ seleniumhq \硒\硒Firefox的驅動程序\ 2.0b3 \硒Firefox的驅動程序,2.0b3.jar; 錯誤打開zip文件

這是我在我的POM文件

<dependency> 
    <groupId>org.seleniumhq.selenium</groupId> 
    <artifactId>selenium</artifactId> 
    <version>2.0rc2</version> 
    <type>pom</type> <i tried with and without type pom> 
</dependency> 

我使用JDK 1.6,Maven的3.0.1中號正在使用Maven編譯器插件2.3.2等在Windows XP

package com.usps.mgo.icoa.UI; 

import static org.hamcrest.CoreMatchers.is; 
import static org.hamcrest.CoreMatchers.not; 
import static org.junit.Assert.assertThat; 

import org.junit.After; 
import org.junit.Before; 
import org.junit.Test; 
import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.WebElement; 
import org.openqa.selenium.firefox.FirefoxDriver; 
import org.apache.log4j.Logger; 
import org.openqa.selenium.firefox.FirefoxProfile; 
import org.springframework.context.support.ClassPathXmlApplicationContext; 
import org.springframework.context.support.ReloadableResourceBundleMessageSource; 

import javax.swing.plaf.basic.BasicInternalFrameTitlePane; 
import java.util.List; 
import java.util.Locale; 

/** 
* Created by IntelliJ IDEA. 
* User: kondojis 
* Date: 2/8/11 
* Time: 5:02 PM 
* To change this template use File | Settings | File Templates. 
*/ 
public class SimulatorTests { 
    private static final Logger logger = Logger.getLogger(SimulatorTests.class); 
    private static WebDriver driver; 
    private ReloadableResourceBundleMessageSource messageSource; 
    private static ClassPathXmlApplicationContext springCtx; 

    /** 
    * Properties for Simulator tests 
    */ 

    @Before 
    public void setUp() { 
     // Bootstrap Spring Framework. 
     springCtx = new ClassPathXmlApplicationContext(
       new String[]{"test-config.xml"}); 
     //Make Sure that test_global.properties file is always in sync with the global.properties file from production. 
     messageSource = springCtx.getBean("messageSource", ReloadableResourceBundleMessageSource.class); 
     driver = new FirefoxDriver(); 
    } 

回答

0

打開zip文件時出現錯誤,聽起來像是在本地存儲庫中損壞的jar。嘗試刪除「C:\ Documents and Settings \ kondojis.m2 \ repository \ org \ seleniumhq \ selenium \ selenium-firefox-driver \」目錄並讓maven重新下載它。

編輯:注意到你的硒依賴性和錯誤輸出有不同的版本,我宣佈類似

<dependency> 
     <groupId>org.seleniumhq.selenium</groupId> 
     <artifactId>selenium-firefox-driver</artifactId> 
     <version>2.0rc2</version> 
     <scope>test</scope> 
    </dependency> 
+0

我試圖刪除文件夾手動依賴,再次讓行家下載。同樣的結果。我嘗試了2以上的所有版本,並遇到同樣的情況。是的,在我上面添加的代碼中,版本標籤存在差異,但是在我的代碼中,它的全部對齊,並且正確無誤。 舊版本0.6.1039和0.9.7376工作正常,直到Firefox升級到最新和最大,所有hellp打破配置文件。 – 2011-06-17 19:38:04