Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeanShell PostProcessor not work with maven #365

Open
liuxiaopiao opened this issue Mar 17, 2020 · 5 comments
Open

BeanShell PostProcessor not work with maven #365

liuxiaopiao opened this issue Mar 17, 2020 · 5 comments

Comments

@liuxiaopiao
Copy link

liuxiaopiao commented Mar 17, 2020

When reporting an issue:

  • Mention versions of Java, JMeter, Maven and JMeter-Maven-Plugin
    jmeter-maven-plugin.version: 2.8.3
    JMeter:5.2.1
    JDK:1.8
  • Provide pom.xml and any log file (jmeter.log, maven logs)
<profiles>
        <profile>
            <id>performance</id>
            <build>
                <plugins>
                    <!-- execute JMeter test -->
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.8.3</version>
                        <executions>
                            <execution>
                                <id>test</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!--plugin setting-->
                            <jmeterExtensions>
                                <artifact>kg.apc:jmeter-plugins-casutg:2.6</artifact>
                            </jmeterExtensions>
                            <propertiesJMeter>                              <jmeter.save.saveservice.response_data>true</jmeter.save.saveservice.response_data>                               
                            </propertiesJMeter>
                            <!--jvm setting-->
                            <jMeterProcessJVMSettings>
                                <xms>1024</xms>
                                <xmx>1024</xmx>
                                <!--<arguments>-->
                                    <!--<argument>-Xprof</argument>-->
                                    <!--<argument>-Xfuture</argument>-->
                                <!--</arguments>-->
                            </jMeterProcessJVMSettings>
                            <ignoreResultFailures>false</ignoreResultFailures>
                            <generateReports>true</generateReports>
                            <!--test file setting-->
                            <testFilesIncluded>                           
                                <jMeterTestFile>test.jmx</jMeterTestFile>                                  
                            </testFilesIncluded>                           
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
</profiles>
  • Explain clearly the reproducer:
    • What should happen (OK Case)
      In order to save properties generated during executing JMeter steps, I have added one JsonExtractor and Beanshell post process to parse attributes and save it to one csv file like below:
      image
      And I can get the generated CSV file when I invoking the JMeter testing from JMeter UI.
    • What happens (KO Case)
      If I added the JMeter in java project with jmeter-maven-plugin and invoke it from command like like "mvn verify -Pperformance". I couldn't find the generated CSV file.

Could you please help me check what's the root cause? Thanks a lot.

@Ardesco
Copy link
Contributor

Ardesco commented Mar 17, 2020

Support for JMeter 5.2.1 was not added until version 3.0.0 of the plugin.

Could you try with the latest version of the plugin and see how that affects this issue.

@liuxiaopiao
Copy link
Author

Hi @Ardesco thanks for the reply. With 3.0.0 plugin,still couldn't get the generated csv file which was written by Beanshell post processor.

@Ardesco Ardesco self-assigned this Mar 18, 2020
@liuxiaopiao
Copy link
Author

@Ardesco any updates or workaround for this? Thanks a lot.

@joweywen
Copy link

Support for JMeter 5.2.1 was not added until version 3.0.0 of the plugin.

Could you try with the latest version of the plugin and see how that affects this issue.

I also have the same problem.BeanShell PostProcessor not work with jmeter-maven-plugin 3.1.0.
BeanShell PostProcessor like below:
`import org.json.*;

String response_data = prev.getResponseDataAsString();
JSONObject JsonData = new JSONObject(response_data);
String NewData = JsonData.toString();
vars.put("8D",NewData);
`
In the local jmeter it be ok.But not work with jmeter-maven-plugin 3.1.0.

@joweywen
Copy link

@Ardesco any updates or workaround for this? Thanks a lot.

Can u resolve it now?if you can resolved it,please tell me ,thank you very much.

@Ardesco Ardesco removed their assignment Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants