Search code examples
jmeterjmeter-pluginsjmeter-maven-plugin

JMeter-WebDriver Sampler integration with maven using Jmeter-maven plugin


Just wanted to know, whether jmeter-maven plugin supports jmeter webdriver integration or not?

Thanks!


Solution

  • Yes it works but you should ensure you use last version of jmeter-maven-plugin.

    Read this detailed blog on how to proceed.

    A working pom.xml should be:

        <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>