Sebb,
Appreciate your help. I had the HTTP sampler and added the following:
1. Regular Expression Extractor
Response Field to check: Body
Reference Name: portalInstance
Regular Expression: \>(8[012])\<
Template: $1$
Match No.: 0
Default Value: none
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");
JButton button = new JButton( piPort0 + "|" + piPort1 + "|" + piPort2 +
"|" + piPort3);
JFrame frame = new JFrame( "My Frame" );
frame.getContentPane().add( button, "Center" );
frame.pack();
frame.setVisible(true);
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
match in the HTTP response data and it looks as follows:
<td width="20%" align="right" bgcolor="#F6F6F6"><font
color="#777777" size="2">81</font></td>
<td width="20%" align="right" bgcolor="#F6F6F6"><font
color="#777777" size="2">portal2</font></td>
I must be reading the RE Extracted value wrong. Can you help please?
--Nikolaos
sebb wrote:
On 20/09/2007, Nikolaos Giannopoulos <[EMAIL PROTECTED]> wrote:
Hi,
We have a JMeter plan that hits a JSP on site that has 9 web instances
behind a load balancer. The JSP presents information on the instance
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 look at all the JSP pages manually until we
see that we have 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 automate 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 represent the instance hit and track that
against a "global" list
3. once all instances are hit in the "global" list - simply stop the test
4. print a message on the screen saying something like "All 9 instances
running" once test 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 / help would be
appreciated.
If you are competent in Java, then it should not be too hard.
Read the mailing list for BSH examples.
Thanks,
--Nikolaos
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Nikolaos Giannopoulos
Director, BrightMinds Software Inc.
e. [EMAIL PROTECTED]
w. www.brightminds.org
t. 1.613.822.1700
f. 1.613.822.1915
c. 1.613.797.0036
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]