JMeter parameter for default-address is not favored

346 views
Skip to first unread message

zuzik...@gmail.com

unread,
Aug 28, 2016, 12:24:17 AM8/28/16
to codename-taurus
Hi Andrey and the team,

thanks for the great tool!

Currently, I'm writing a bunch of scenarios to test our API flow that runs in containers/Jenkins; thus, there is no dedicated IP address. 
The problem is that I'm trying to use JMeter parameters in scenarios' default-address; however, it looks like the Taurus doesn't pick it up.
All scenarios in pure yaml and not in jmx


scenarios:
 
doing_stuff
:
  
default-address: ${__P(
zt_address)}
 doing_stuff2:
  
default-address: ${__P(
zt_address)}

modules
:
 jmeter
:
   path
: ./jmeter-bin
   properties
:
     zt_address
: 'http://192.168.99.101:80'


when I tried to workaround it by doing this:

requests:
- body:
  param1
: ${param1}
url
: '${__P(zt_address)}/api/v1/token'
method: GET


the param1 is not sent with the request. In the GUI everything is rendered perfectly - IP, port are in place in the path, but no luck with the param1 in the request


Thank you again

pri...@blazemeter.com

unread,
Aug 29, 2016, 10:01:53 AM8/29/16
to codename-taurus, zuzik...@gmail.com
Hi,

1. The 'default-address' option.
Taurus uses the 'default-address' option to create 'HTTP Request Defaults' configuration element in JMX. Taurus interprets it as URL, splits it into 3 components (protocol, domain and port) and writes these components to JMX. When given a JMeter expression (e.g. ${__P(zt_address)}), Taurus fails to parse it as URL, so it does't add any default-address related settings to JMX. I guess currently there's no way to use the JMeter expression in place of default address.

2. JMeter 'body' is not sent with the request.
IIRC, JMeter doesn't use `body` option when performing a GET request. It only uses it for POST and PUT. If you want to use these parameters as part of URL (i.e. http://example.com/page?param1=value), you should put them in `url`:
url: '${__P(zt_address)}/api/v1/token?param1=${param1}'

Also, ${param1} syntax will use JMeter variable, not a property, so be careful.


  Dmitri

zuzik...@gmail.com

unread,
Aug 29, 2016, 12:10:45 PM8/29/16
to codename-taurus, zuzik...@gmail.com
Hi Dmitri,

Appreciate your detailed feedback.

For the second point, It actually sends automatically the 'body' param1 parameter with a GET request when I remove this part from URL: "${__P(zt_address)}"
So, in looks like there is another parsing limitation in the Taurus. 
Combining with the 'default-address' limitation it is going to be tedious to manage a lot of API flows. I have to either somehow replace all IP addresses in all scenarios or handcraft all URLs with parameters included.

Is it qualified as an issue?

Thank you

Zuzikovitch

unread,
Aug 30, 2016, 11:18:28 PM8/30/16
to codename-taurus
Sorry guys, bumping it.

Is there any other possibility to have a single point of entry for a default IP address for all scenarios.
We are talking about 300+ different scenarios running in a Jenkins/Docker pipeline.

Thank you

Andrey Pokhilko

unread,
Aug 31, 2016, 4:43:08 AM8/31/16
to codenam...@googlegroups.com

Hi,

I like the challenge of 300+ different scenarios. This is very practical situation, so let's find a way to solve it.

Can you provide me with several examples of those 300 scenarios? I want to see what is the input of the process. Then, well choose the way of implementing it.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
-- You received this message because you are subscribed to the Google Groups "codename-taurus" group. To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/2E9A4647-DA85-4BEC-8536-43413384EC45%40gmail.com. For more options, visit https://groups.google.com/d/optout.

zuzik...@gmail.com

unread,
Aug 31, 2016, 11:09:30 PM8/31/16
to codename-taurus
Hi Andrey,

I'd really like to share the whole file with you; however, there is too much to obfuscate because it explains the whole API architecture, which is not open-sourced and not my property.
As I mentioned in my initial post, I'd really like to have `default-address` parameterized, so every scenarios can be tuned up for a particular IP address from JMeter properties.
In terms of the scenarios, there is a lot of just single API calls to trigger some events and get responses. And there is big usage of `include-scenario` to simulate a flow.

As an additional proposal, I'd be really good to have a `file-writer` in a scenario to dump data into a file, like 'token', and reused it in a different scenario with `data-sources`. 
In this case, we can use just pure YAML and re-use a lot of written scenarios and not to duplicate them in a big flow with many 'url' under a one `requests'

Keep up good work!

Andrey Pokhilko

unread,
Sep 1, 2016, 4:16:46 AM9/1/16
to codenam...@googlegroups.com

I'm asking for representing examples because there might be several ways to deal with the situation.

One of them is using command-line overrides like "-o scenarios.myscen1.default-address=abc". For certain class of configs, this will be sufficient.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
-- You received this message because you are subscribed to the Google Groups "codename-taurus" group. To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/c441d921-c175-49d2-a2f2-76753ddd4aab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

Andrey Pokhilko

unread,
Sep 1, 2016, 9:41:07 AM9/1/16
to codenam...@googlegroups.com

Version 1.6.8 was just released. It contains fix to handle properties in default address, example format is:

default-address: https://${__P(hostname)}:${__P(port)}

Please note that http/https is mandatory.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
On 09/01/2016 06:09 AM, zuzik...@gmail.com wrote:
-- You received this message because you are subscribed to the Google Groups "codename-taurus" group. To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/c441d921-c175-49d2-a2f2-76753ddd4aab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Message has been deleted

zuzik...@gmail.com

unread,
Sep 1, 2016, 11:00:12 PM9/1/16
to codename-taurus
My last message was caught in the spam filter.

Andrey Pokhilko

unread,
Sep 6, 2016, 7:18:42 AM9/6/16
to codenam...@googlegroups.com

Hi,

Please also look at this example, it might demonstrate useful trick for you: https://github.com/Blazemeter/taurus/blob/master/examples/jmeter/default-address-trick.yml


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
On 08/31/2016 06:18 AM, Zuzikovitch wrote:
-- You received this message because you are subscribed to the Google Groups "codename-taurus" group. To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/2E9A4647-DA85-4BEC-8536-43413384EC45%40gmail.com. For more options, visit https://groups.google.com/d/optout.

zuzik...@gmail.com

unread,
Sep 6, 2016, 8:55:10 AM9/6/16
to codename-taurus
Thank you for the trick, Andrey. I'm also reposting my spammed message:

This is fantastic! Thanks a million, Andrey and Dmitri!

Just verified 1.6.8 and it works flawlessly.

If I can reiterate my additional suggestion - a 'file-writer' would be an extremely helpful addition to scenarios - this will allow a true inheritance among scenarios with `include-scenario` and data to pass. No more copy-pasting.

Anyway, thank you again for such a great support and the gem.

zuzik...@gmail.com

unread,
Sep 8, 2016, 8:11:32 PM9/8/16
to codename-taurus, zuzik...@gmail.com
Andrey, 

thanks again for this trick: https://github.com/Blazemeter/taurus/blob/master/examples/jmeter/default-address-trick.yml
Had parameterized 'data-sources' and saved 5 lines in each scenario.
Reply all
Reply to author
Forward
0 new messages