Selenium Webdriver测试在Maven项目中执行两次

时间:2014-02-25 19:07:23

标签: java maven selenium-webdriver

通过IntelliJ IDE执行scipts时,测试只执行一次。

(不确定是因为@ Suite.SuiteClasses。)请评论。

pom.xml的详细信息是

<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>
  <groupId>com.selenium.webdriver</groupId>
  <artifactId>webdriver</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>webdriver</name>
  <url>http://maven.apache.org</url>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
      <dependency>
          <groupId>org.seleniumhq.selenium</groupId>
          <artifactId>selenium-java</artifactId>
          <version>2.39.0</version>
      </dependency>
  </dependencies>
    <build>
    <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
    </plugin>
    </plugins>
    </build>
  </project>

1 个答案:

答案 0 :(得分:0)

我有类似的问题。通过终端上的intellij或右键单击该功能执行测试时,只运行一次测试。但是,詹金斯盒子正在执行两次测试。在jenkins工作的工作空间下“擦除了当前的工作空间”,并为我解决了这个问题。

相关问题