jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ZK <stevesenio...@gmail.com>
Subject Re: How to read full data from a txt file by using Beanshell script
Date Wed, 27 Sep 2017 15:50:51 GMT
Hi, 

this would do it: 

import org.apache.jmeter.util.JMeterUtils; 
String fileContents = new File('./nameOfFileToRead.txt').getText('UTF-8'); 
vars.put("your_fileContentsVariableName",fileContents); 
println(fileContents); 

Use a JSR223 Sampler with the language set to groovey 

This script assumes the 'nameOfFileToRead.txt' is in your jmeter bin folder 

ZK



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message