0
votes

I want to run Jmeter tests using Maven (in my case, it is Maven 2), so I can integrate it in Jenkins . I tried to do it using WSO2 Test Automation Framework following this tutorial but I got this error:

Missing artifact org.wso2.carbon.automation:org.wso2.carbon.automation.tools.jmeter:jar:4.0.8:compile

I also try another approach which is the use of the Jmeter plugin like they mentioned here

I don't get any error but when i run my project in Maven using the goal verify, there is no test to run despite i put the TestJmeter.jm file in the src/test/java document. For the maven-war-plugin i add it to my POM because i work on a dynamic web project.

Here is my POM file:

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>e-conseil</groupId>
  <artifactId>e-conseil</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
 <build>
       <pluginManagement>
            <plugins>
                  <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                        <warSourceDirectory>WebContent</warSourceDirectory>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>1.8.1</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
</build>

</project>

I don't know if I'm just missing something or this is a wrong approach.

2

2 Answers

1
votes

Put the test plan in src/test/jmeter, not src/test/java.

0
votes

I made a complete example of running Jmeter from the jmeter-maven-plugin as a GUI. And, of course, you can run command line also, without a GUI.