import java.io.File;
import java.io.FileOutputStream;
email = vars.get("email1");
password = vars.get("password");
log.info(email); // if you want to log something to jmeter.log file
// Pass true if you want to append to existing file
// If you want to overwrite, then don't pass the second argument
f = new FileOutputStream("C:/Users/njs.s/Desktop/Njs/Jmeter/MarketJmeterScripts/csvfile.csv", true);
p = new PrintStream(f);
this.interpreter.setOut(p);
print(email + "," + password);
f.close();
2 回答
您需要的只是一个Beanshell Sampler,您将在生成登录凭据后放置它 . 在其中,您可以使用以下内容:
希望这可以帮助...
我使用常规提取器来获取电子邮件和密码值,并使用以下代码将其传递到beanshell并将其写入文件 .