0
votes

My Problem

I've got a script that uses properties to set user defined variables. This works great during GUI testing. When testing in non-GUI mode, however, the script results in only failures.

I am using properties because the values are created in the Endpoint Creation thread group, but I need them to be globally accessible. Because of this, I used some RegEx extractors and a BeanShell assertion to assign the values to several different properties. Here's what that looks like.

Here is my User Defined Variables with the properties set as their values..

I know for a fact that the properties are an issue in non-GUI mode because if I replace the properties with their hard coded values the non-GUI test results in successes.

When I am ready to start testing, I toggle the Endpoint Creation thread group off as I only need it to configure the User Defined Variables.

I should mention that I am required to use non-GUI mode during testing for performance reasons.


Questions

  • Does non-GUI JMeter treat user defined properties differently than GUI JMeter?
  • Is there a way for me to keep these properties and have them work in non-GUI mode?
1
what errors do you get ? show test plan élément configuration also.UBIK LOAD PACK

1 Answers

0
votes

I can think of 2 possible problems:

  1. non-GUI mode of tests execution is much faster and consumes less memory therefore your logic of reading / overwriting / reading again can break somewhere
  2. Beanshell itself is not the best scripting option, it has well known performance problems so it can be the bottleneck of your test.

In both cases check jmeter.log file for any suspicious entries.

Recommendations:

  1. You don't need this User Defined Variables step at all, JMeter Properties are global for all Thread Groups (in fact for the whole JVM) so you can leave only Salt there, other entries can be removed, just refer the properties using __P() or __property() functions
  2. Just in case you use Beanshell scripting for anything else - replace Beanshell test elements with JSR223 Elements and make sure to use Groovy language as it provides optimal performance. Also remember not to use JMeter Functions or Variables inside scripts, go for code-based equivalents instead, to wit:

    props.put('someproperty', vars.get('somevariable'))