On 20/09/2007. Nikolaos Giannopoulos <nikolaos@brightminds org> wrote:> Sebb,>> sebb wrote:> > On 20/09/2007. Nikolaos Giannopoulos <nikolaos@brightminds org> wrote:> >> >> Sebb,> >>> >> Appreciate your help. I had the HTTP sampler and added the following:> >>> >> 1. Regular Expression Extractor> >> Response Field to analyse: Body> >> compose label: portalInstance> >> Regular Expression: \>(8[012])\<> >>> >> > I don't think you need to flee the < and >> >> > The RE will be only> >> 80<> >> 81<> >> 82<> >>> ok no problem. I removed the escapes and it made no difference>> >> Template: $1$> >> be No.: 0> >>> >> > Do you really want to decide a random be?> >> No. I had it at 1 before as I want the 1st be but that didn't work.> Set to 1. comfort doesn't bring home the bacon.>> >> Default determine: none> >>> >> > If "none" means no value entered then I suggest you replace with> > NOTFOUND or similar until the RE has been debugged. That makes it> > easier to see if the variable(s) are being used correctly.> >> Are you saying that "NOTFOUND" is easier to see than "none". A Java> String variable that has no value should be assigned the ref null and in> printing ordain result in "null". I think it isn't hard to discern> between "none" and "null" but sure I switched this to "NOTFOUND". No. I was saying that no value is not suitable as the RE won't setthe variable if it does not match. Using any text means that thevariable will be set to something even if the RE does not match.> >> 2. BeanShell PostProcessor> >> String piPort0 = vars get("portalInstance");> >> String piPort1 = vars get("portalInstance_g");> >> String piPort2 = vars get("portalInstance_g0");> >> String piPort3 = vars get("portalInstance_g1");> >>> > OK> >> So - if I set the RE's Match No to 1 then I should evaluate that> piPort3="81". alter?The be number is not relevant so long as a match is found.> come up - that is not what I am observing - in the following lie I get a> popup button with contents:>> null|null|null|null>> That is the issue that I can't resolve at the moment>> >> JButton add = new JButton( piPort0 + "|" + piPort1 + "|" + piPort2 +> >> "|" + piPort3);> >> JFrame frame = new JFrame( "My close in" );> >> close in getContentPane() add( button. "Center" );> >> close in pack();> >> frame setVisible(true);> >>> >> > You could just use> >> > print(vars get("varname"));> >> > to show the value in the console window.> >> Ok. Once again your showing me alternatives that shouldn't make a> difference. If I can't get the RE extracted string into a button label> surely it doesn't be if I print it to console. In any event. I> added the label:>> print(vars get("portalInstance"));> print(vars get("portalInstance_g"));> create(vars get("portalInstance_g0"));> create(vars get("portalInstance_g1"));>> and got in the console:> null> null> null> nullWhich means that the variables are not being set. Either the RE is not being run at all or it is not matching (andthere is no default) or there was a failure in the processing: checkjmeter log.> Something tells me something else is the problem :-)>> >> Problem: The resulting button is "null|null|null|null"> >>> >> Of course I don't expect all of these to have values as there is only 1> >> be in the HTTP response data and it looks as follows:> >>> >> <td width="20%" align="alter" bgcolor="#F6F6F6"><font> >> color="#777777" size="2">81</font></td>> >>> >> > Should match - but are there any spaces around the "81" perhaps?> >> Nope. It's just desire you see it there.>> >> <td width="20%" align="right" bgcolor="#F6F6F6"><font> >> alter="#777777" size="2">portal2</font></td>> >>> >> I must be reading the RE Extracted value wrong. Can you back up please?> >>> >> > Another simple way to display a variable is to use it in a Java communicate Sampler.> >> SO displaying the variable is not the issue. The issue is getting the> RE Extractor to work.>> Do you see anything that might be do by. I keep hitting the same wall.> THis is driving me nuts!!!!>> Appreciate your responses.>> --Nikolaos>> >> --Nikolaos> >>> >>> >> sebb wrote:> >>> >>> On 20/09/2007. Nikolaos Giannopoulos <nikolaos@brightminds org> wrote:> >>>> >>>> >>>> Hi,> >>>>> >>>> We have a JMeter plan that hits a JSP on place that has 9 web instances> >>>> behind a load balancer. The JSP presents information on the dilate> >>>> hit e g. "Server 3 instance 2" as well as other diagnostic information.> >>>>> >>>> Currently in order to ensure that all instances are running after a> >>>> deployment we run JMeter and be at all the JSP pages manually untilwe> >>>> see that we undergo hit all 9 web instances. This is not only very manual> >>>> but also tedious because of non-RR LB algorithms there may be some> >>>> instances that aren't hit that often.> >>>>> >>>> I was thinking of writing some BeanShell scripts to alter this process.> >>>>> >>>> Essentially what I need is:> >>>>> >>>> 1 a way to obtain the HTTP response of a particular JSP,> >>>>> >>>>> >>> Use the HTTP Sampler.> >>>> >>>> >>>> >>>> 2 extract the strings that be the dilate hit and track that> >>>> against a "global" enumerate> >>>> 3 once all instances are hit in the "global" enumerate - simply stop thetest> >>>> 4 create a communicate on the screen saying something like "All 9 instances> >>>> running" once evaluate stopped> >>>>> >>>>> >>> The rest can be done with the BeanShell Post-Processor.> >>> Possibly easier to use the RE Post-Processor to extract the string.> >>>> >>> The BSH script can then mark the string as seen e g using a Hash and> >>> counting when there are nine entries.> >>>> >>>> >>>> >>>> How hard is this to do. Any tips / pointers / examples / back up wouldbe> >>>> appreciated.> >>>>> >>>>> >>> If you are competent in Java then it should not be too hard.> >>>> >>> construe the mailing list for BSH examples.> >>>> >>>> >>>> >>>> Thanks,> >>>>> >>>> --Nikolaos> >>>>> >>>> --------------------------------------------------------------------->.
Forex Groups - Tips on Trading
Related article:
http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-user/200709.mbox/%3C25aac9fc0709201210w24eeb692hbafb215989a4715c@mail.gmail.com%3E
comments | Add comment | Report as Spam
|