jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Jara <marceloj...@hotmail.com>
Subject Issue with javascript math function in Jmeter 3.3
Date Sat, 13 Jan 2018 21:32:01 GMT
Hello,


I'm running into an issue with Jmeter 3.3. It seems the Math.floor() Javascript function is
behaving differently when compared to older versions such as 2.12. I've simplified the call
below for this email.


${__intSum(${__javaScript(Math.floor(${667}/60))},${extra},)}



667/60 = 11.1166    so the Math.floor function should return 11. Instead it's returning the
exception below. It seems Math.floor is not evaluating to an Int.


2018-01-13 16:23:12,808 ERROR o.a.j.JMeter: Uncaught exception:
java.lang.NumberFormatException: For input string: "11.0"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_152]
        at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_152]
        at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_152]
        at org.apache.jmeter.functions.IntSum.execute(IntSum.java:67) ~[ApacheJMeter_functions.jar:3.3
r1808647]
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:137)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:112)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:101)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.testelement.property.AbstractProperty.getIntValue(AbstractProperty.java:108)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsInt(AbstractTestElement.java:238)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.threads.AbstractThreadGroup.getNumThreads(AbstractThreadGroup.java:209)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.engine.StandardJMeterEngine.startThreadGroup(StandardJMeterEngine.java:509)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:457)
~[ApacheJMeter_core.jar:3.3 r1808647]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]




Any suggestions?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message