Selen 2.0 Webdriver тестирует ошибки компиляции - PullRequest
0 голосов
/ 15 июня 2011

Независимо от того, какие веб-драйверы версии Selenium 2.xx я использую, я получаю одинаковые ошибки компиляции

: ошибка чтения C: \ Documents and Settings \ kondojis.m2 \ repository \ org \seleniumhq \ селена \ селен-светлячок-драйвер \ 2.0b3 \ селен-светлячок-водитель-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 M использую плагин компилятора 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();
    }

1 Ответ

0 голосов
/ 17 июня 2011

Ошибка при открытии zip-файла звучит как поврежденная банка в вашем локальном репо. Попробуйте удалить каталог "C: \ Documents and Settings \ kondojis.m2 \ repository \ org \ seleniumhq \ selenium \ selenium-firefox-driver \" и заставить maven повторно загрузить его.

edit: Заметили, что у вашей зависимости от селена и вывода ошибок разные версии, я объявляю ручную зависимость, как

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