我曾嘗試:如何在JMeter中讀取XML文件?
//${__FileToString(C:\\QC\\qa\\Testlink\\Jmeter\\Expected\\test.xml,ASCII,${xmlFile})};
發現錯誤消息: 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.
也,我試着用${__StringFromFile}
並得到了相同的錯誤信息,甚至與BeanShell的腳本是:
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));
謝謝sooo多德米特里....它的工作:) –