Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何配置";xml";到jmeter_Jmeter_Jmeter Maven Plugin - Fatal编程技术网

如何配置";xml";到jmeter

如何配置";xml";到jmeter,jmeter,jmeter-maven-plugin,Jmeter,Jmeter Maven Plugin,我的POM.xml是 <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">

我的POM.xml是

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.idea.perf.test</groupId>
    <artifactId>jmeter-perf-tests</artifactId>
    <version>4.1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>jmeter-perf-tests</name>

    <properties>
        <jmeterScriptFile>Jmeter-Gemini-UI-RatePlanReport.jmx</jmeterScriptFile>
        <jmeterThreads>2</jmeterThreads>
        <jmeterRampUpTime>1</jmeterRampUpTime>
        <jmeterLoopCount>1</jmeterLoopCount>
        <Port>443</Port>
        <UrlProtocol>https</UrlProtocol>
        <UrlDomainName>stageg.com</urlDomainName>
        <PropertyList>..\..\..\src\test\properties\GeminiStressboxUI.csv</PropertyList>
        <BinaryDir>..\..\..\src\test\binaries</BinaryDir>
        <jmeterRunScriptFor>RPtHomePage,SelectRCRange,SelectDateRange,SelectMultiPropertyGroups</jmeterRunScriptFor>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.adobe.blazeds</groupId>
                <artifactId>blazeds-common</artifactId>
                <version>3.2.0.3978</version>
            </dependency>
            <dependency>
                <groupId>com.adobe.blazeds</groupId>
                <artifactId>blazeds-core</artifactId>
                <version>3.2.0.3978</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>a</artifactId>
                <version>1.2</version>
                <classifier>id</classifier>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>blazemeter</artifactId>
                <version>1.2</version>
                <classifier/>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>a_newAmfProxyConverter</artifactId>
                <version>1.2</version>
                <classifier/>
            </dependency>
            <dependency>
                <groupId>serializeFlex</groupId>
                <artifactId>org.racso.jmeter</artifactId>
                <version>0.0.1</version>
                <classifier/>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>amf_custom_plugin</artifactId>
                <version>1.0</version>
                <classifier>idea</classifier>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>b</artifactId>
                <version>1.2</version>
                <classifier/>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-assets</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/../jmeter/lib/ext</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.jmeter</groupId>
                                    <artifactId>JMeter-AMF</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.adobe.blazeds</groupId>
                                    <artifactId>blazeds-common</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.adobe.blazeds</groupId>
                                    <artifactId>blazeds-core</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.jmeter</groupId>
                                    <artifactId>a</artifactId>
                                    <classifier>idea</classifier>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.jmeter</groupId>
                                    <artifactId>a_newAmfProxyConverter</artifactId>
                                    <classifier/>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.jmeter</groupId>
                                    <artifactId>blazemeter</artifactId>
                                    <classifier/>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>serializeFlex</groupId>
                                    <artifactId>org.racso.jmeter</artifactId>
                                    <classifier/>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.jmeter</groupId>
                                    <artifactId>b</artifactId>
                                    <classifier/>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.jmeter</groupId>
                                    <artifactId>amf_custom_plugin</artifactId>
                                    <classifier>idea</classifier>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Execute JMeter Script-->
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>1.9.0</version>
                <configuration>
                    <suppressJMeterOutput>false</suppressJMeterOutput>
                    <overrideRootLogLevel>debug</overrideRootLogLevel>
                    <jmeterLogLevel>DEBUG</jmeterLogLevel>
                    <testFilesIncluded>
                        <testFilesIncluded>${jmeterScriptFile}</testFilesIncluded>
                    </testFilesIncluded>
                    <jMeterProcessJVMSettings>
                        <xms>4096</xms>
                        <xmx>4096</xmx>
                        <arguments>
                            <argument>-Xprof</argument>
                            <argument>-Xfuture</argument>
                        </arguments>
                    </jMeterProcessJVMSettings>
                    <propertiesUser>
                        <jmeterThreads>${jmeterThreads}</jmeterThreads>
                        <jmeterRampUpTime>${jmeterRampUpTime}</jmeterRampUpTime>
                        <jmeterLoopCount>${jmeterLoopCount}</jmeterLoopCount>
                        <UrlProtocol>${UrlProtocol}</UrlProtocol>
                        <Port>${Port}</Port>
                        <UrlDomainName>${rlDomainName}</UrlDomainName>
                        <PropertyList>${PropertyList}</PropertyList>
                        <BinaryDir>${BinaryDir}</BinaryDir>
                        <jmeterRunScript>${jmeterRunScript}</jmeterRunScript>
                    </propertiesUser>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Execute JMeter Reports-->
            <!--<plugin>-->
                <!--<groupId>com.lazerycode.jmeter</groupId>-->
                <!--<artifactId>jmeter-analysis-maven-plugin</artifactId>-->
                <!--<version>1.0.0</version>-->
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<goals>-->
                            <!--<goal>analyze</goal>-->
                        <!--</goals>-->
                        <!--<phase>post-integration-test</phase>-->
                        <!--<configuration>-->
                            <!--<source>${project.build.directory}/jmeter/results/*</source>-->
                            <!--<targetDirectory>${project.build.directory}/reports</targetDirectory>-->
                            <!--<generateCSVs>true</generateCSVs>-->
                            <!--<generateCharts>true</generateCharts>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                <!--</executions>-->
            <!--</plugin>-->
        </plugins>
    </build>
</project>


4.0.0
com.idea.perf.test
jmeter性能测试
4.1.0-快照
聚甲醛
jmeter性能测试
Jmeter-Gemini-UI-RatePlanReport.jmx
2.
1.
1.
443
https
stageg.com
..\..\..\src\test\properties\GeminiStressboxUI.csv
..\..\..\src\test\binaries
RPT主页、SelectRCRange、SelectDateRange、SelectMultiPropertyGroup
com.adobe.blazeds
白斑
3.2.0.3978
com.adobe.blazeds
blazeds核心
3.2.0.3978
org.apache.jmeter
A.
1.2
身份证件
org.apache.jmeter
火焰计
1.2
org.apache.jmeter
一种新的AMFProxyconverter
1.2
序列化Flex
org.racso.jmeter
0.0.1
org.apache.jmeter
amf_自定义_插件
1
主意
org.apache.jmeter
B
1.2
org.apache.maven.plugins
maven依赖插件
复制资产
包裹
复制
${project.build.outputDirectory}/./jmeter/lib/ext
org.apache.jmeter
JMeter-AMF
com.adobe.blazeds
白斑
com.adobe.blazeds
blazeds核心
org.apache.jmeter
A.
主意
org.apache.jmeter
一种新的AMFProxyconverter
org.apache.jmeter
火焰计
序列化Flex
org.racso.jmeter
org.apache.jmeter
B
org.apache.jmeter
amf_自定义_插件
主意
com.lazerycode.jmeter
jmetermaven插件
1.9.0
假的
调试
调试
${jmeterScriptFile}
4096
4096
-Xprof
-X未来
${jmeterThreads}
${jmeterRampUpTime}
${jmeterLoopCount}
${UrlProtocol}
${Port}
${rlDomainName}
${PropertyList}
${BinaryDir}
${jmeterRunScript}
测试
预集成测试
性能测试
您能建议我应该把这个文件放在哪里,以及如何将这个文件中的值读入JMeter吗

例如:


${jmeterThreads}
假设您定义以下块:

<properties>
    <jmeterThreads>1</jmeterThreads>
</properties>
此外,还可以使用-D命令行参数修改值,如:

mvn -DjmeterThreads=100 clean verify
其他属性也应该以同样的方式处理

参考资料:


完整的pom.xml文件以防万一:

<?xml version="1.0" encoding="UTF-8"?>
<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>org.apache</groupId>
    <artifactId>jmeter-maven</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <jmeterThreads>1</jmeterThreads>
    </properties>

    <build>
        <plugins>
            <plugin>
                <configuration>
                    <propertiesUser>
                        <jmeterThreads>${jmeterThreads}</jmeterThreads>
                    </propertiesUser>
                </configuration>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>2.8.1</version>
                <executions>
                    <!-- Run JMeter tests -->
                    <execution>
                        <id>jmeter-tests</id>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                    <!-- Fail build on errors in test -->
                    <execution>
                        <id>jmeter-check-results</id>
                        <goals>
                            <goal>results</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

4.0.0
org.apache
杰米特·马文
1.0-快照
1.
${__P(jmeterThreads)}
mvn -DjmeterThreads=100 clean verify
<?xml version="1.0" encoding="UTF-8"?>
<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>org.apache</groupId>
    <artifactId>jmeter-maven</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <jmeterThreads>1</jmeterThreads>
    </properties>

    <build>
        <plugins>
            <plugin>
                <configuration>
                    <propertiesUser>
                        <jmeterThreads>${jmeterThreads}</jmeterThreads>
                    </propertiesUser>
                </configuration>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>2.8.1</version>
                <executions>
                    <!-- Run JMeter tests -->
                    <execution>
                        <id>jmeter-tests</id>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                    <!-- Fail build on errors in test -->
                    <execution>
                        <id>jmeter-check-results</id>
                        <goals>
                            <goal>results</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
    <propertiesJMeter>
         <BUILD_TAG>${project.version}</BUILD_TAG>
         <threads>7</threads>
         <duration>30</duration>
     </propertiesJMeter>