Re: Passing variables to Random function
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)} which works fine. On Wed, Aug 22, 2018 at 8:06 AM Felix Schumacher < felix.schumac...@internetallee.de> 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: user-unsubscr...@jmeter.apache.org > For additional commands, e-mail: user-h...@jmeter.apache.org > >
Re: Passing variables to Random function
On 22 August 2018 at 16:14, Felix Schumacher wrote: > > > Am 22.08.2018 um 17:06 schrieb Felix Schumacher: >> >> >> >> 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). > > On second thought "bug" might be a bit harsh, as no function in JMeter will > currently transform those values by itself (yet?). It's not a bug (or even a feature). It's not supported. Variables were designed to be used for replacement of fixed text in test plans. e.g.. instead of http://a.b.c:80/ one could have the following textual definitions (e.g. on the Test Plan): HOST=a.b.c PORT=80 and use the following instead: http://${HOST}:${PORT}/ It so happens that the variables are stored in a structure that allows the values to be arbitrary objects. This proved useful for passing data between scripts (putObject/getObject), but was never intended for use in the test plan textual substitution functionality. Variables that are used in test plan elements must have values that are Strings. A simple way to fix the errors is to ensure that the script stores the value as a String (e.g. using a new variable name). > To answer your question, you could use __evalVar function to convert your > Integer into a String: > > ${__Random(0,${__evalVar(numFiles)})} > > Regards, > Feli > > > > - > To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org > For additional commands, e-mail: user-h...@jmeter.apache.org > - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Recording Swagger and Apiary data
hi, Can we record Api request and response from Apiary and swagger alike we do for Postman collection via Http Test script recorder ? -- sent via device, pls ignore typos. -- ::DISCLAIMER:: This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from disclosure under applicable law. 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 have received this e-mail in error, please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.
Re: Passing variables to Random function
Am 22.08.2018 um 17:06 schrieb Felix Schumacher: 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). On second thought "bug" might be a bit harsh, as no function in JMeter will currently transform those values by itself (yet?). To answer your question, you could use __evalVar function to convert your Integer into a String: ${__Random(0,${__evalVar(numFiles)})} Regards, Feli - To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Re: Passing variables to Random function
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: user-unsubscr...@jmeter.apache.org For additional commands, e-mail: user-h...@jmeter.apache.org
Error writing to Graphite: connect timed out
Hi All, I'm facing the below issue: 2018-08-22 11:59:36,963 INFO o.a.j.e.StandardJMeterEngine: Running the test!2018-08-22 11:59:36,964 INFO o.a.j.s.SampleEvent: List of sample_variables: []2018-08-22 11:59:36,967 INFO o.a.j.v.b.BackendListener: Backend Listener - Graphite: Starting worker with class: class org.apache.jmeter.visualizers.backend.graphite.GraphiteBackendListenerClient and queue capacity: 50002018-08-22 11:59:36,967 INFO o.a.j.v.b.BackendListener: Backend Listener - Graphite: Started worker with class: class org.apache.jmeter.visualizers.backend.graphite.GraphiteBackendListenerClient2018-08-22 11:59:36,972 INFO o.a.j.v.b.g.TextGraphiteMetricsSender: Created TextGraphiteMetricsSender with host: 172.31.1.202, port: 2003, prefix: jmeter.2018-08-22 11:59:36,973 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)2018-08-22 11:59:37,000 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group2018-08-22 11:59:37,000 INFO o.a.j.e.StandardJMeterEngine: Starting 2 threads for group Thread Group.2018-08-22 11:59:37,000 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error2018-08-22 11:59:37,000 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=2 ramp-up=5 perThread=2500.0 delayedStart=false2018-08-22 11:59:37,001 INFO o.a.j.t.ThreadGroup: Started thread group number 12018-08-22 11:59:37,001 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started2018-08-22 11:59:37,003 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-12018-08-22 11:59:37,455 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-12018-08-22 11:59:37,455 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-12018-08-22 11:59:38,974 ERROR o.a.j.v.b.g.TextGraphiteMetricsSender: Error writing to Graphite: connect timed out2018-08-22 11:59:39,504 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-22018-08-22 11:59:39,942 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-22018-08-22 11:59:39,943 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-22018-08-22 11:59:39,944 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test2018-08-22 11:59:39,945 INFO o.a.j.v.b.BackendListener: Worker ended2018-08-22 11:59:39,987 ERROR o.a.j.v.b.g.TextGraphiteMetricsSender: Error writing to Graphite: Connection refused: connect2018-08-22 11:59:40,988 ERROR o.a.j.v.b.g.TextGraphiteMetricsSender: Error writing to Graphite: connect timed out2018-08-22 11:59:40,989 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*) Even i tried changing the port 2003 to 8088 same issue persist. Looking for support to overcome the above issue. Regards, Krishna - +91-9884451279. CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype