問題は、2 番目のループがファイルの先頭を見つけられなかったときに発生します。ファイル変数に設定されたEOFを常に取得します。---ループ回数が 10 で、csv の値が 1 より大きい場合に、常に EOF を取得する方法がわかりませんでした。
私の提案は、スレッドグループ(1ユーザー1反復)にbeanshellサンプラーを持ち、すべての値をprop変数に渡すことです。
可能なコードは次のとおりです。
//ExtrenalCSVTd=path of your csv file
LineNumberReader lineReader = new LineNumberReader(new FileReader(new File(vars.get("ExtrenalCSVTd"))));
int count=0;
while((line=lineReader.readLine())!= null)
{
String[] ExtrenalCSVTd = line.split(",");
props.put("ContentFirstColumn_"+count,ExtrenalCSVTd[0]);
props.put("COntentSecondColumn_"+count,ExtrenalCSVTd[1]);
/*
.
.
.
*/
count++;
}
usejp@gc - Set Variables Action
および useCounter=${__BeanShell(vars.getIteration();,)}
を使用して、(スレッドの) 現在のループ数を取得します
その後、使用できますcontentName=${__P(ContentFirstColumn_${Counter},)}