Hi Kiran,
Thanks for your response :)
I got really a proper guidance to write the param to a CSV file.
it didnt work for me using RegEx Extractor instead i used XPath Xtractor.
Below are steps :
*1) Xpath Extractor*
Reference Name: xxx
XPath Query: //*[local-name()='securityCode']/text()
Default Value : 11111111
*2) BeanShell PostProcessor*
*Script:*
String file1="C:/JMETER/GenSecCodes.csv";
String yyy = vars.get("xxx");
response = prev.getResponseDataAsString().toLowerCase(Locale.US);
FileWriter fw = new FileWriter(file1,true);
PrintWriter pw = new PrintWriter(fw);
pw.println(yyy);
//Flush the output to the file
pw.flush();
//Close the Print Writer
pw.close();
//Close the File Writer
fw.close();
*Thanks *
*Jayesh Guru*
On Wed, Jan 22, 2014 at 2:32 PM, KIRAN <[email protected]> wrote:
> Hi Jayesh,
>
> You can do this by following the below steps:
>
> 1. Add Regular Expression Extractor to extract value using the settings:
> Reference Name: xxx
> Regular Expression: <TagName>(.+?)</TagName>
> Template: $1$
> Match No: -1
>
> 2. Add BeanShell PostProcessor and build java code to read the xml response
> and writing it to a csv file.
> I did the same kind of solution to extract values from the response xml.
>
> below is some code with which you can start with:
>
> --------------------------------------------------------------------------------------------
> String yyy = vars.get("xxx");
> response = prev.getResponseDataAsString().toLowerCase(Locale.US);
> BufferedWriter outLoge = new BufferedWriter(new FileWriter("<CSV file
> path>", true));
> outLoge.write(yyy);
>
> --------------------------------------------------------------------------------------------
> Hope this will give you a good start.
>
> Regards,
> Kiran
>
>
> On Tue, Jan 21, 2014 at 8:51 PM, sebb <[email protected]> wrote:
>
> > On 22 January 2014 00:51, Jayesh Guru <[email protected]> wrote:
> > > Hello,
> > >
> > > I am trying to find a way to save XML response fields in a csv file in
> > > SOAP/XML-RPC Request Sampler.
> >
> > Not possible; responses can only be saved in XML files.
> >
> > > eg. in below response i want to save securityCode Values in a csv file
> > >
> > > <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="
> > > http://schemas.xmlsoap.org/soap/envelope/
> > "><soapenv:Body><ns5:GenerateSecurityCodeResponse
> > > xmlns:ns5="http://mpsys.ril.att.com/generatesecuritycoderesponse/v1"
> > xmlns="
> > > http://cio.att.com/commonheader/v3" xmlns:ns6="
> > > http://mpsys.ril.att.com/verifysecuritycoderequest/v1" xmlns:ns7="
> > > http://mpsys.ril.att.com/verifysecuritycoderesponse/v1" xmlns:ns2="
> > > http://mpsys.ril.att.com/deletesecuritycoderequest/v1" xmlns:ns3="
> > > http://mpsys.ril.att.com/deletesecuritycoderesponse/v1" xmlns:ns4="
> > > http://mpsys.ril.att.com/generatesecuritycoderequest/v1
> > > "><ns5:transactionId>GSBCss02</ns5:transactionId>
> > > *<ns5:securityCode>43101112</ns5:securityCode>*
> > >
> >
> <ns5:securityCodeExpires>02102011</ns5:securityCodeExpires></ns5:GenerateSecurityCodeResponse></soapenv:Body></soapenv:Envelope>
> > >
> > > Can Anyone help me in this regard?
> > >
> > > *Thanks *
> > > *Jayesh Guru*
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Regards,
> Kiran
>