jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xenofon Papadopoulos <xpa...@gmail.com>
Subject Re: BeanShell_Script.
Date Tue, 26 Mar 2013 12:58:08 GMT
If there is a single val element below list with name="UID", you can use
the following XPath expression to get its value:

/list/val[@name="UID"]/text()

If this is only a chunk of your XML and there are other wrapper elements,
you might have to use something like:

//val[@name="UID"]/text()

(again, assuming the val with name="UID" is unique)




On Tue, Mar 26, 2013 at 2:37 PM, madhu sekhar <madhuvchandana@gmail.com>wrote:

> Darren,
>
> In My request what could be the *XPath Query*?
>
> Thanks & Regards,
> Madhu
>
> On Tue, Mar 26, 2013 at 5:45 PM, Darren Bown <dazzlebown@gmail.com> wrote:
>
> > Madhu,
> >
> > Parsing [X|H]TML with scripts is very tricky, especially when trying to
> use
> > a regex to do it - which you undoubtedly would end up attempting. You're
> > much better off using an XPath extractor:
> >
> >
> >
> http://jmeter.apache.org/usermanual/component_reference.html#XPath_Extractor
> >
> > Cheers,
> > Darren.
> >
> >
> > On 26 March 2013 12:04, madhu sekhar <madhuvchandana@gmail.com> wrote:
> >
> > > Hi Team,
> > >
> > > We have API Request as below:
> > >
> > >  <list>
> > >       <val name="DatabaseID">ABC</val>
> > >       <val name="QueryLanguage">en</val>
> > >       <val name="UID">ABC:00013564789</val>
> > >       <list name="Editions">
> > >         <map>
> > >           <val name="Collection">ABC</val>
> > >           <val name="Edition">CBI</val>
> > >           <val name="Begin">1991-01-01</val>
> > >           <val name="End">2009-12-31</val>
> > >         </map>
> > >       </list>
> > >
> > >
> > > Could any one please suggest, What should be the bean shell script to
> > > capture the dynamic Value.
> > >
> > > *< val name="UID">ABC:00013564789</val>?*
> > >
> > > Thanks & Regards,
> > > Madhu
> > >
> >
> >
> >
> > --
> > Darren Bown
> > tel:* +44(0)*7873 163 452
> > tel: *+44(0)7971 078 445*
> >
>
>
>
> --
> madhu kk
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message