2015-09-04 33 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

相關問題