4
votes

I want to run a jmeter script using IntelliJ and Maven. Basicaly my goal is to run a jmeter script thru Jenkins. I did following steps:

  1. Downloaded Jmeter source code and extracted all files under C:\Jmeter\apache-jmeter-3.3
  2. Created a script by launching jmeter using jmeter.bat
  3. Saved the script under C:\Jmeter\apache-jmeter-3.3\bin\templates\create-client.jmx

  4. Created a new Maven Project in IntelliJ under new folder C:\Jmeter-test

  5. Copied report-template, reportgenerator.properties under src/test/resources
  6. Copied create-client.jmx under src/test/jmeter/create-client.jmx

  7. Modifiled pom.xml to include Jmeter plugin

    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>1.6.1</version>
            <executions>
                <execution>
                    <id>jmeter-tests</id>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <testFilesIncluded>
                    <jMeterTestFile>create-client.jmx</jMeterTestFile>
    
                </testFilesIncluded>
            </configuration>
        </plugin>
    

When i run mvn verify command, it sayd 'No Tests to Run'. I am not very familiar with IntelliJ and Maven. Not sure if i need to import existing Jmeter souce code.Any help would be appreaciated. Thanks!

1
put the script in <Project Dir>/src/test/jmeterKiril S.
@KirilS. have the script under C:\Jmeter-test\src\test\jmeter\create-client.jmx and still mvn verify output is 'No Tests to run'garima
once again, scripts should be in project directory, under src/test/jmeterKiril S.

1 Answers

3
votes

As per this documentation :

Use version 2.7.0 and it should be ok:

     <plugin>
    <groupId>com.lazerycode.jmeter</groupId>
    <artifactId>jmeter-maven-plugin</artifactId>
    <version>2.7.0</version>
    <executions>
        <execution>
            <id>jmeter-tests</id>
            <goals>
                <goal>jmeter</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <testFilesIncluded>
            <jMeterTestFile>create-client.jmx</jMeterTestFile>

        </testFilesIncluded>
    </configuration>
</plugin>