I think this is worthy enough to be said.

Regular expression also allows to search along multiple lines. You should
use (?s) to enable DOTALL pattern.
This will work, but I've got it working using two Regex Extractors. I'm not
that proficient to get a head shot with regex :)

First regex will extract $1$ group which will contain all the option tags
inside the select[name=levelOne]
(?s)<select[^>]*name="levelOne"[^>]*>[^<\/select>]*(.*?)<\/select>

Second regex will get the one that is selected. value on group $1$ and
description on group $2$
<option[^>]*value="([^"]*)"[^>]*selected="selected"[^>]*>([^<]*)<\/option>

I don't know if this will run faster than CSS/JQuery Extractor, but worth
the try.

I really love this type of question, that makes me burn some brain cells
and learn with it.


2013/2/5 Michael Sobczak <[email protected]>

> Hi Philippe,
>
> I'm out-of-the-office for the rest of today.  I will try first thing
> tomorrow morning and let you know.
>
>
> Thanks!
>
> - Mike.
>
>
> ________________________________
>  From: Philippe Mouawad <[email protected]>
> To: JMeter Users List <[email protected]>; Michael Sobczak <
> [email protected]>
> Sent: Tuesday, February 5, 2013 4:28 PM
> Subject: Re: Using CSS/jQuery Extractor
>
> Is it working for you ?
>
> On Tue, Feb 5, 2013 at 10:13 PM, Philippe Mouawad <
> [email protected]> wrote:
>
> > For  just the value 71000:
> >
> > CSS/JQuery Expression : select[name=levelOne]>option[selected=selected]
> > Attribute : value
> >
> >
> > On Tue, Feb 5, 2013 at 10:11 PM, Philippe Mouawad <
> > [email protected]> wrote:
> >
> >> To get 71000 - Northeast, just remove Attribute value (ie make it empty)
> >> instead of value
> >>
> >>
> >> On Tue, Feb 5, 2013 at 10:08 PM, Michael Sobczak <[email protected]
> >wrote:
> >>
> >>> I need both the selected option value, which would be "71000"
> >>>
> >>> I also need the text ("71000 - Northeast"), if possible.
> >>>
> >>>
> >>>
> >>>
> >>> ________________________________
> >>>  From: Philippe Mouawad <[email protected]>
> >>> To: JMeter Users List <[email protected]>; Michael Sobczak <
> >>> [email protected]>
> >>> Sent: Tuesday, February 5, 2013 4:01 PM
> >>> Subject: Re: Using CSS/jQuery Extractor
> >>>
> >>> And what do you want to extract exactly ?
> >>>
> >>> On Tue, Feb 5, 2013 at 9:53 PM, Michael Sobczak <[email protected]>
> >>> wrote:
> >>>
> >>> > OK, second try:
> >>> >
> >>> > <div class="selectBox" />
> >>> > <label for="levelOne">Region:</label>
> >>> > <select name="levelOne" id="levelOne" onchange="areaMenuAction("
> >>> > http://server/app/?","levelOne";, this, true, true);">
> >>> >     <option value="71000" selected="selected">71000 -
> >>> Northeast</option>
> >>> > </select>
> >>> >
> >>> >
> >>> >
> >>> > ________________________________
> >>> >  From: Philippe Mouawad <[email protected]>
> >>> > To: JMeter Users List <[email protected]>; Michael Sobczak <
> >>> > [email protected]>
> >>> > Sent: Tuesday, February 5, 2013 3:35 PM
> >>> > Subject: Re: Using CSS/jQuery Extractor
> >>> >
> >>> >
> >>> > Hello,
> >>> >
> >>> > What does your HTML response contain ? can you show it ?
> >>> >
> >>> > Thanks
> >>> >
> >>> >
> >>> > Regards
> >>> > Philippe
> >>> >
> >>> > Follow me on twitter
> >>> >
> >>> > UBIK-INGENIERIE on TWITTER
> >>> >
> >>> > UBIK LOAD PACK BLOG
> >>> >
> >>> >
> >>> >
> >>> > On Tue, Feb 5, 2013 at 9:32 PM, Michael Sobczak <[email protected]>
> >>> > wrote:
> >>> >
> >>> > It doesn't look like that picture came through.  Here are the
> settings
> >>> I
> >>> > used (that don't work):
> >>> > >
> >>> > >
> >>> > >Apply to: Main sample and sub-samples
> >>> > >CSS/JQuery Extractor Implementation: (blank)
> >>> > >
> >>> > >Reference Name: levelOneVar
> >>> > >CSS/JQuery expression: select[name=levelOne]
> >>> > >Attribute: value
> >>> > >Match No.: 1
> >>> > >Default Value: (blank)
> >>> > >
> >>> > >
> >>> > >
> >>> > >________________________________
> >>> > > From: Michael Sobczak <[email protected]>
> >>> > >To: jMeter Users List <[email protected]>
> >>> > >Sent: Tuesday, February 5, 2013 3:16 PM
> >>> > >Subject: Using CSS/jQuery Extractor
> >>> > >
> >>> > >
> >>> > >
> >>> > >I'm trying to get the value of a select, but I keep getting the name
> >>> of
> >>> > the jQuery parameter back ({levelOneVar}).
> >>> > >
> >>> > >I've saved the response to a file, and the select does have an
> option
> >>> > selected, and the option has a value associated with it.
> >>> > >
> >>> > >I've attached a picture of how I've set this up.  Any advice would
> be
> >>> > much appreciated.
> >>> > >
> >>> > >
> >>> > >Thanks,
> >>> > >
> >>> > >- Mike.
> >>> > >
> >>> > >
> >>> > >
> >>> >
> >---------------------------------------------------------------------
> >>> > >To unsubscribe, e-mail: [email protected]
> >>> > >For additional commands, e-mail: [email protected]
> >>> >
> >>> >
> >>> > --
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Cordialement.
> >>> Philippe Mouawad.
> >>>
> >>
> >>
> >>
> >> --
> >> Cordialement.
> >> Philippe Mouawad.
> >>
> >>
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
> >
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Reply via email to