2015-09-04 78 views
0

我的JMeter脚本的执行过程中使用Maven面临的问题2.11 我也尝试过使用命令行运行的JMeter脚本“MVN JMeter的的JMeter -DperformancethreadCount = 3,但在这两个(使用詹金斯命令行&)未能执行目标com.lazerycode.jmeter:JMeter的,Maven的插件: Maven的版本:3.2.1 的JMeter版本:1.10.0

Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.0:jmeter (default-cli) on project Jmeter_Integration: D:\svn_workspace\Jmeter_Integration\target\jmeter\results\Jmeter_Jenkins.jtl (The system cannot find the file specified) -> [Help 1] 
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
    [ERROR] Re-run Maven using the -X switch to enable full debug logging. 
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles: 
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 
    Build step 'Invoke top-level Maven targets' marked build as failure 



    <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>Jmeter_Integration</groupId> 
     <artifactId>Jmeter_Integration</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
     <packaging>jar</packaging> 

     <name>Jmeter_Integration</name> 
     <url>http://maven.apache.org</url> 

    <build>   
    <plugins>    
    <plugin>    
      <groupId>com.lazerycode.jmeter</groupId>    
      <artifactId>jmeter-maven-plugin</artifactId>    
      <version>1.10.0</version>    
        <configuration>     
       <testResultsTimestamp>false</testResultsTimestamp>     
       <propertiesUser>      
          <threadCount>${performancetest.threadCount}</threadCount>  
       </propertiesUser>     
       <propertiesJMeter>      
       <jmeter.save.saveservice.thread_counts>true</jmeter.save.saveservice.thread_counts>     
       </propertiesJMeter>    
      </configuration> 
      <executions>     
       <execution>      
       <id>jmeter-tests</id>      
       <phase>verify</phase>      
       <goals>      
        <goal>jmeter</goal>      
       </goals>     
       </execution>    
      </executions>    
      </plugin>   
     </plugins>  
     </build> 

    </project> 

请指导或提供解决方案或让我知道面临着同样的错误,如果我的思念任何配置

谢谢..

回答

0

我可以看到2个问题,你的配置:

  • mvn JMeter:JMeter命令不会工作,除非你有一些自定义插件安装
  • 你有

    • performancetest.threadCount - 在“POM .xml“
    • performancethreadCount - 在命令行中

    和这些属性名称需要是相同

按照下面的步骤来解决此问题:

  1. JMeter's Thread Group定义 “线程数” 为

    ${__P(threadCount,)} 
    
  2. 您的测试结构应如下所示:

    • 的pom.xml
    • SRC
    • 测试
      • JMeter的
      • yourtest.jmx
  3. 执行你的测试为:

    MVN -Dperformancetest.threadCount = 3清洁验证

mvn -Dperformancetest.threadCount=3 clean install 

见一般信息JMeter Maven Plugin维基页面和Five Ways To Launch a JMeter Test without Using the JMeter GUI指南上JMeter的测试可以如何执行Maven的驱动和其他选项额外的提示。

+0

我已经在选项3中使用https://blazemeter.com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui中的定义更正了我的步骤:使用APACHE MAVEN。我还删除了线程数参数,并保持它的静态值,并使用根文件夹中的“mvn verify”或“mvn insall”命令运行我的Jmeter脚本。同时运行Jmeter的Test.jmx脚本来检查与maven的集成,但面临同样的错误。请让我知道还有哪些其他更正是需要的。谢谢。 – user5300641