Hi,
Evaluation of these strings is made by JMeter, not by Taurus.
It's difficult to troubleshoot in theory. Can you compose config
file demonstrating your problem and post it here? Then I'll be
able to understand what exactly you do and how to solve it.
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
--
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/945a487f-1545-400a-80c9-6f73c6fe7b3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
Evaluation of these strings is made by JMeter, not by Taurus.
It's difficult to troubleshoot in theory. Can you compose config file demonstrating your problem and post it here? Then I'll be able to understand what exactly you do and how to solve it.
Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69 On 19.01.2017 10:25, Peter Boling wrote:
I need to get a variable reference to a username which I can reuse in subsequent requests.I need it to increment on the counter for each user in each thread.Ideally also reference the time of the test run, but utilize the same time value for all requests in a single thread loop of a scenario.
I'd like something a bit like this:"smoke-test-${project-name}.${__time()}.${__counter(TRUE, 'uniq_user_counter')}.${__threadNum}@example.com"
To be evaluated to something like this:
No matter where I define this type of string (as a variable on the scenario, as a property on the scenario, as the value of a body sent in a POST) it always comes out in JMeter as the literal string: "smoke-test-${project-name}.${__time()}.${__counter(TRUE, 'uniq_user_counter')}.${__threadNum}@example.com", rather than the evaluated version.
I can't find any docs for Taurus on how to get the ${__counter()}, ${__time()}, or ${__threadNum} to evaluate, or where I should place them in the .yml file.
Hi,
I actually took your config and ran it without modifications like
this "bzt example.yml -gui". This brought up the JMeter UI for me
to review the resulting test plan.
I reviewed body of "register" sampler and saw there the explected JSON template: '{"username": "smoke-test-${project-name}.${__time()}.${__counter(TRUE, 'uniq_user_counter')}.${__threadNum}@example.com", "password": "some-password"}'
Then I enabled View Results Tree component (it is always added by Taurus to be ready for debugging) and ran the script. It produced two samples with POST bodies:
{"username":
"smoke-test-api_smoke_...@example.com",
"password": "some-password"}
{"username":
"smoke-test-api_smoke_...@example.com",
"password": "some-password"}
Which looks like expected evaluation for me... So I don't
understand what is wrong with the config. Can you clarify it for
me? Where to look to see the non-evaluated functions.
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
Hi,
I actually took your config and ran it without modifications like this "bzt example.yml -gui". This brought up the JMeter UI for me to review the resulting test plan.
I reviewed body of "register" sampler and saw there the explected JSON template: '{"username": "smoke-test-${project-name}.${__time()}.${__counter(TRUE, 'uniq_user_counter')}.${__threadNum}@example.com", "password": "some-password"}'
Then I enabled View Results Tree component (it is always added by Taurus to be ready for debugging) and ran the script. It produced two samples with POST bodies:
{"username": "smoke-test-api_smoke_test.14849070...@example.com", "password": "some-password"}
{"username": "smoke-test-api_smoke_test.14849070...@example.com", "password": "some-password"}
I'd put it under "variables" and assign to variable, then use the variable.. Like this:
variables:
timestamp: ${__time()}
In JMeter, global variables are evaluated once and very early in
the execution.
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/5c6ce8e5-efb0-4287-ac0b-1bc4288a488a%40googlegroups.com.