私はWSDL石鹸サービス用のスクリプトを作成しようとしています。私の要件は、Beanshell Postporcessorを使用してポイント応答出力パラメータ値をCSV結果ファイルに出力したいのです。JmeterでBeanshell Postprocessorを使用してCSV結果ファイルにSOAP応答パラメータを出力できませんか?
以下はSOAPの応答です。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<CardResponse xmlns="http://service.clp.eks.com">
<out>
<birthDate xmlns="http://wsform.clp.eks.com">05-04-00</birthDate>
<cardno xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
<customerName xmlns="http://wsform.clp.eks.com">krishna singhji</customerName>
<flag xmlns="http://wsform.clp.eks.com">TRUE</flag>
<memberLevel xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
<points xmlns="http://wsform.clp.eks.com">**500.0**</points>
<reason xsi:nil="true" xmlns="http://wsform.clp.eks.com"/>
</out>
</CardResponse>
</soap:Body>
</soap:Envelope>
私のBeanShellスクリプトは次のとおりです。私の結果は、ポイントの値を表示し、としてnull値を表示するファイルではなく試験プランを実行した後
import java.io.File;
import org.apache.jmeter.services.FileServer;
CardNo =vars.get("cardno");
Result = "FAIL";
Response = prev.getResponseDataAsString();
if(Response.contains("TRUE"))
Result = "PASS";
Points = vars.get("points");
f = new FileOutputStream("F:\\Java_Applications\\apache-jmeter-3.1\\bin\\CardsResults.csv",true);
p=new PrintStream(f);
this.interpreter.setOut(p);
p.println(CardNo + "," + Points + "," + Result);
f.close();
、このissue.ASAP
を解決する方法を私を助けてください
返信いただきありがとうございます。Xpath ExtractorとDebug Samplerを使用していて、csvファイルに2つのレコードが挿入されています.4回繰り返して8レコードがCSVファイルに挿入されている場合は1回繰り返します。 –