Я вызываю функцию $ {__ UUID ()} в моем скрипте, чтобы сгенерировать UUID, используя препроцессор параметров пользователя. ![UserParameter](https://i.stack.imgur.com/ubgLh.png)
Этот $ {__ UUID ()} работает нормально и генерирует UUID при выполнении скрипта jmx из Jmeter gui или Jmeter без графического интерфейса / cmd.
Jmeter Log: 2020-04-14 15: 24: 44,173 ИНФОРМАЦИЯ oajuBeanShellTestElement: UUID =======> 3c8114da-1657-4e99-85bd-49081be0172b
Но всякий раз, когда я пытаюсь выполнить этот тот же самый jmx-скрипт из моей среды JMeter-Maven, он завершается с ошибкой только в запросе с использованием этой функции $ {__ UUID ()}.
Jmeter Log: 2020-04-14 15: 03: 05,695 ИНФОРМАЦИЯ oajuBeanShellTestElement: UUID =======> $ {__ UUID ()}
Насколько я понимаю, на основе журналов невозможно сгенерировать UUID с использованием функции $ {__ UUID ()} при выполнении сценарий из среды JMeter-Maven.
Ошибка, сгенерированная в HTML Отчет по запросу с использованием функции $ {__ UUID ()}: Код ответа не HTTP: java. net .URISyntaxException / Ответ не HTTP сообщение: недопустимый символ в запросе с индексом 43
Вот мой pom. xml 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>JMeterMavenImpletation</groupId>
<artifactId>JMeterMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>JMeterMaven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.jmeter/ApacheJMeter_core -->
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_core</artifactId>
<version>5.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jmeter/ApacheJMeter_http -->
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_http</artifactId>
<version>5.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jmeter/ApacheJMeter_components -->
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_components</artifactId>
<version>5.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.jmeter/ApacheJMeter_functions -->
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_functions</artifactId>
<version>5.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.lazerycode.jmeter/jmeter-maven-plugin -->
<dependency>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.0</version>
<executions>
<!-- This goal will run the load test and generate the HTML report -->
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- This goal runs some verification on error rate and fails the build -->
<!-- <execution> <id>check-results</id> <phase>verify</phase> <goals>
<goal>results</goal> </goals> </execution> -->
</executions>
<configuration>
<!-- JVM Metrics -->
<jMeterProcessJVMSettings>
<arguments>
<argument>-XX:MaxMetaspaceSize=256m</argument>
<argument>-Xmx1024m</argument>
<argument>-Xms1024m</argument>
<argument>-Xprof</argument>
<argument>-Xfuture</argument>
</arguments>
</jMeterProcessJVMSettings>
<!-- Test Script Properties -->
<propertiesUser>
<users>${users}</users>
<rampup>${rampup}</rampup>
<loop>${loop}</loop>
</propertiesUser>
<!-- Fetching Test Script -->
<testFilesIncluded>
<jMeterTestFile>${jMeterScriptFile}</jMeterTestFile>
</testFilesIncluded>
<!-- Time stamp -->
<testResultsTimestamp>true</testResultsTimestamp>
<!-- HTML Reports -->
<generateReports>true</generateReports>
</configuration>
</plugin>
<plugin>
<!-- https://mvnrepository.com/artifact/de.codecentric/jmeter-graph-maven-plugin -->
<groupId>de.codecentric</groupId>
<artifactId>jmeter-graph-maven-plugin</artifactId>
<version>0.1.0</version>
<configuration>
<inputFile>${project.build.directory}/jmeter/results/20190808-Scripts_SampleScript.jtl</inputFile>
<!-- Custom Graphs -->
<graphs>
<graph>
<pluginType>ResponseTimesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ActiveThreadsOverTime.png</outputFile>
</graph>
<graph>
<pluginType>HitsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/BytesThroughputOverTime.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseCodesPerSecond.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesDistribution.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesOverTime.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesPercentiles.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThroughputVsThreads.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesVSThreads.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TransactionsPerSecond.png</outputFile>
</graph>
</graphs>
</configuration>
</plugin>
</plugins>
</build>
* 102 0 *
Буду очень признателен, если кто-нибудь поможет мне решить эту проблему!