Am 23.08.2018 um 16:07 schrieb Deepak Shetty:
Hi
title worked too
For me now, too.
The test cases I used - and the reported stacktraces - showed that an
Integer will not be converted automatically to a String by the Random
function. And I probably misspelled my variable name and got the error
when I tested it through the GUI. It seems that the GUI is trying harder
to convert the complete function string components to string values
before giving the values to the Random function.
Thanks for your double checking and insistence.
Felix
regards
deepak
On Thu, Aug 23, 2018 at 1:43 AM Felix Schumacher <
[email protected]> wrote:
Am 23.08.2018 um 03:42 schrieb Deepak Shetty:
Hi
I initially tried this with a string , but I dont get this issue with an
integer either - How were you able to replicate
Thread group
+Bean Shell sampler // vars.putObject("numFiles",new Integer(10));
+Http Request
++ParamValue - ${__Random(0,${numFiles},docIndex)}
Try to use the title of a sampler. Parameters seem to be handled
differently.
Felix
which works fine.
On Wed, Aug 22, 2018 at 8:06 AM Felix Schumacher <
[email protected]> wrote:
Am 21.08.2018 um 21:32 schrieb David Fertig:
I have a variable called numFiles, which I can print and verify
contains
an integer.
Integer numFiles = vars.getObject("numFiles");
I want to make a random number between 0 and that value. But all of
the
following fail
${__Random(0,__ ${numFiles},docIndex)};
Integer docIndex = ${__Random(0,${numFiles})};
${__Random(0,__ numFiles,docIndex)};
Integer docIndex = ${__Random(0,numFiles)};
All with an errors like:
Uncaught Exception java.lang.NumberFormatException: For input string:
"${NUMFILES}". See log file for details.
Uncaught Exception java.lang.NumberFormatException: For input string:
"numFiles". See log file for details.
How do I pass a variable into the random() function?
It seems that this is a bug. At the moment the Strings given to __Random
will not be evaluated (and therefore the Integer will not be transformed
into a String).
Till the bug is fixed, you will have to transform the Integer into a
String by yourself.
Regards,
Felix
Thank you
David
This email, including attachments, may contain information that is
privileged, confidential or is exempt from disclosure under applicable
law
(including, but not limited to, protected health information). It is not
intended for transmission to, or receipt by, any unauthorized persons.
If
the reader of this message is not the intended recipient, or the
employee
or agent responsible for delivering the message to the intended
recipient,
you are hereby notified that any dissemination, distribution or copying
of
this communication is strictly prohibited. If you believe this email was
sent to you in error, do not read it. Please notify the sender
immediately
informing them of the error and delete all copies and attachments of the
message from your system. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]