I have tried:
//${__FileToString(C:\\QC\\qa\\Testlink\\Jmeter\\Expected\\test.xml,ASCII,${xmlFile})};
Found error message :
org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval In file: inline evaluation of: ``//<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/At . . . '' Encountered "<" at line 2, column 1.
also, I tried with ${__StringFromFile}
and got the same error message and even with beanshell script that is:
import org.apache.jmeter.services.FileServer;
//Open the file
FileInputStream fstream = new FileInputStream("C://QC//qa//Testlink//Jmeter//Expected//test.xml");
//Get the object of DataInputStream
DataInputStream instream = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(instream));
Try out the following:
Put the following code into the sampler's "Script" area:
Add Debug Sampler and View Results Tree listener to your Test Plan
${content}
variable is set. If not - look into jmeter.log file and search for the lineFailed to read "test.xml" file
. If exception stacktrace below this line tells you nothing - post it here.See How to Use BeanShell: JMeter's Favorite Built-in Component guide for more information on using Beanshell in your JMeter test.