Hello all, 

 

I would like to add for my successful samplers timestamp which will be saved
to an outer text file, how can I do it? I have used Jmeter function:
${__javaScript(Math.round(new Date().getTime() / 1000))}, but I did not find
a way how to save it I have added postprocessor beanshell with the following
code:

 

 

int temp = ${__javaScript(Math.round(new Date().getTime()))};

FileWriter fstream = new
FileWriter("C:\\path\\to\\my\directory\\timestamp.txt")

BufferedWriter out = new BufferedWriter(fstream);

out.write(temp + "\n");

out.close();

 

I am getting the following error message:

 

2015/05/27 13:14:39 INFO  - jmeter.services.FileServer: Stored:
C:\Users\QA\git\QA\Tests\Load_Tests\Jmeter_Scripts\Access_Tokens\textLinux.t
xt Alias:
C:\Users\QA\git\QA\Tests\Load_Tests\Jmeter_Scripts\Access_Tokens\textLinux.t
xt@31914453 

2015/05/27 13:14:44 ERROR - jmeter.util.BeanShellInterpreter: Error invoking
bsh method: eval Parse error at line 1, column 12 : Error or number too big
for integer type: 1432721684364 

2015/05/27 13:14:44 WARN  - jmeter.assertions.BeanShellAssertion:
org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval
Parse error at line 1, column 12 : Error or number too big for integer type:
1432721684364

 

I have tried to use double in order to solve it still it did not save it to
text file.

 

Thanks for any help.

 

 


Erez Naim  |  QA Lead  |
<http://www.linkedin.com/profile/view?id=34323263>
<http://www.theneura.com/vCards/gilad.vcf>
<http://twitter.com/#!/giladmeiri/>   




EL AL 2 Street | Herzliya  
mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura

 


 <http://www.theneura.com/> website  |   <http://www.startupbitz.com/> blog
|   <https://twitter.com/intent/user?screen_name=theneura> twitter  |
<http://goo.gl/maps/ZRkg5> map    

 

 

Reply via email to