OK, I figured this out: CSS/JQuery Expression: select[name=levelOne]>option[selected=selected] Attribute: value
________________________________ From: Michael Sobczak <[email protected]> To: JMeter Users List <[email protected]> Sent: Wednesday, February 6, 2013 9:19 AM Subject: Re: Using CSS/jQuery Extractor Hi Philippe, Using: select[name=levelOne] When there is only one value in the select works fine. I get the single value back. However, when I use the above on a different select where multiple values are present (but only one is selected), I get back all of the values: select[name=levelTwo] All 71100 - Boston 71200 - New York 71300 - Philadelphia 71400 - Pittsburgh 71500 - Washington DC Here's the HTML for select "levelTwo": <select name="levelTwo" id="levelTwo" onchange='areaMenuAction("http://server/app/?", "levelTwo", this, false, true);'> <option value="All">All</option> <option value="71100">71100 - Boston</option> <option value="71200">71200 - New York</option> <option value="71300">71300 - Philadelphia</option> <option value="71400">71400 - Pittsburgh</option> <option value="71500">71500 - Washington DC</option> </select> How to I get the value from a select where only one option is selected? Much thanks, - Mike. ________________________________ From: Philippe Mouawad <[email protected]> To: JMeter Users List <[email protected]>; Michael Sobczak <[email protected]> Sent: Tuesday, February 5, 2013 4:11 PM Subject: Re: Using CSS/jQuery Extractor 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.
