【问题标题】:JMeter-WebDriver Sampler integration with maven using Jmeter-maven pluginJMeter-WebDriver Sampler 使用 Jmeter-maven 插件与 maven 集成
【发布时间】:2017-04-04 10:33:11
【问题描述】:

只是想知道,jmeter-maven插件是否支持jmeter webdriver集成?

谢谢!

【问题讨论】:

    标签: jmeter jmeter-plugins jmeter-maven-plugin


    【解决方案1】:

    是的,它有效,但您应该确保使用最新版本的 jmeter-maven-plugin。

    阅读此详细信息blog,了解如何继续。

    一个工作的 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.foo</groupId>
            <artifactId>test</artifactId>
            <packaging>jar</packaging>
            <version>1.0-SNAPSHOT</version>
            <name>training-project</name>
            <url>http://maven.apache.org</url>
            <dependencies>
            </dependencies>
            <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.6.0</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jmeter-tests2</id>
                                <goals>
                                    <goal>results</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration> 
                            <jmeterExtensions>
                                <artifacts>kg.apc:jmeter-plugins-webdriver:2.3</artifacts>
                            </jmeterExtensions>
                            <excludedArtifacts>
                                <exclusion>commons-pool2:commons-pool2</exclusion>
                                <exclusion>commons-math3:commons-math3</exclusion>
                                <exclusion>com.sun.jdmk:jmxtools</exclusion>
                                <exclusion>com.sun.jmx:jmxri</exclusion>
                            </excludedArtifacts>
                            <ignoreResultFailures>false</ignoreResultFailures>
                            <downloadOptionalDependencies>false</downloadOptionalDependencies>
                            <downloadExtensionDependencies>false</downloadExtensionDependencies>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </project>
    

    【讨论】:

      【解决方案2】:

      确实如此。

      以防万一这是一个最小的 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.blazemeter</groupId>
          <artifactId>mvn-jmeter</artifactId>
          <packaging>jar</packaging>
          <version>1.0-SNAPSHOT</version>
          <name>maven-jmeter-demo</name>
          <url>http://maven.apache.org</url>
          <build>
              <plugins>
                  <plugin>
                      <groupId>com.lazerycode.jmeter</groupId>
                      <artifactId>jmeter-maven-plugin</artifactId>
                      <version>2.1.0</version>
                      <executions>
                          <execution>
                              <id>jmeter-tests</id>
                              <phase>verify</phase>
                              <goals>
                                  <goal>jmeter</goal>
                              </goals>
                          </execution>
                      </executions>
                      <configuration>
                          <jmeterExtensions>
                              <artifact>kg.apc:jmeter-plugins-webdriver:1.4.0</artifact>
                          </jmeterExtensions>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      </project>
      

      还可以查看以下材料:

      【讨论】:

      • 是的..我试过这个,现在得到:原因异常:java.lang.NoClassDefFoundError [INFO]原因消息:org/openqa/selenium/remote/SessionNotFoundException
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-06
      • 2012-10-03
      • 1970-01-01
      相关资源
      最近更新 更多