You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Claus <cl...@gerull.nl> on 2006/07/03 10:20:02 UTC
Javascript function
Hello,
I'm fighting with a bit with the Javascript function in Jmeter. In a test
script I
want to run the following expression:
${__javaScript((9000 * (parseInt('${VarA}') + (parseInt('${VarB}') %
10000))) % 9800)}
All I see in the output is "NaN"
Tested so far:
- the Javascript is tested and works (with JS variables of course)
- as the manual is a bit short on the used syntax and notations, I tried
different
quoting for the Jmeter variables
How can I make this ork?
Thanks in advance,
Claus
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
RE: Javascript function
Posted by Claus <cl...@gerull.nl>.
Hi,
Thanks for the answer. The function was indeed assigned to another variable,
assigning the function direct to query parameter works fine.
-----Original Message-----
From: Vitalie Valache [mailto:Vitalie.Valache@bnm.org]
Sent: maandag 3 juli 2006 12:00
To: jmeter-user@jakarta.apache.org
Subject: Re: Javascript function
Hi,
Nothing wrong with your function, I've tested and it works!
I think maybe the "NaN" value is a result of accessing/assigning wrong
value to variable
Make sure you're not doing this
VarA 10
VarB ${__javaScript((9000 * (parseInt('${VarA}') + (parseInt('${VarB}') %
10000))) % 9800)}
best of all,
--
DISCLAIMER:
Any e-mail messages from the National Bank of Moldova are sent in good
faith, but shall not be binding nor construed as constituting any obligation
on the part of the Bank.
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If you received this in error, please contact the sender and
delete the material from any computer.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Javascript function
Posted by Vitalie Valache <Vi...@bnm.org>.
Hi,
Nothing wrong with your function, I've tested and it works!
I think maybe the "NaN" value is a result of accessing/assigning wrong value to variable
Make sure you're not doing this
VarA 10
VarB ${__javaScript((9000 * (parseInt('${VarA}') + (parseInt('${VarB}') % 10000))) % 9800)}
best of all,
--
DISCLAIMER:
Any e-mail messages from the National Bank of Moldova are sent in good faith, but shall not be binding nor construed as constituting any obligation on the part of the Bank.
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material from any computer.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org