You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Wangke Liao <wa...@yahoo-inc.com> on 2002/09/24 20:27:31 UTC

Usage of _regexFunction

Hi,

I guess I am bit confused on how exactly to use the _regexFunction. I have
something like this:

Thread group
	http req: login
	http req: load profile (the response from this req will have some Ids I am
looking for in <input hidden name="Id" value= ""> format)
	http req: change profile (which needs ID from the response of the last http
req)
		 name = Id, value = ${_regexFunction(xx,xx,xx,xx, getID) (I use the
function helper to generate the string)
		 .....
	http req: update profile
		 name = Id, value = ${getID)
		 ......
	......

Is this the right way to use it. Where exactly should I put the function and
what format should I follow to call the function? I probably should put the
function right after "http req: load profile", but in which kind of
component and in which field?

Thanks.

-WK


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Starting JMeter errors

Posted by Yuri Weinstein <yu...@mercedsystems.com>.
What it should be 1.4?

=====
Thx

YuriW




-----Original Message-----
From: Mike Stover [mailto:mstover1@apache.org] 
Sent: Thursday, September 26, 2002 6-11 PM
To: JMeter Users List
Subject: Re: Starting JMeter errors

I have no idea - my best guess is that your using JDK1.3 and the new
code isn't compatible 
with 1.3.

-Mike

On 26 Sep 2002 at 15:48, Yuri Weinstein wrote:

> Hi all,
> 
> I have not used JMeter for a while and downloaded the latest nightly
> build today and tried to run it and got errors:
> 
> BUILD SUCCESSFUL
> Total time: 32 seconds
> C:\jakarta-jmeter>cd bin
> 
> C:\jakarta-jmeter\bin>jmeter
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.jmeter.NewDriver.main(NewDriver.java:181)
> Caused by: java.lang.NoSuchMethodError:
> processSynchronousLightweightTransfer
>         at java.awt.KeyboardFocusManager.initIDs(Native Method)
>         at java.awt.KeyboardFocusManager.<clinit>(Unknown Source)
>         at javax.swing.UIManager.initialize(Unknown Source)
>         at javax.swing.UIManager.maybeInitialize(Unknown Source)
>         at javax.swing.UIManager.getUI(Unknown Source)
>         at javax.swing.JPanel.updateUI(Unknown Source)
>         at javax.swing.JPanel.<init>(Unknown Source)
>         at javax.swing.JPanel.<init>(Unknown Source)
>         at javax.swing.JPanel.<init>(Unknown Source)
>         at org.apache.jmeter.gui.NamePanel.<init>(NamePanel.java:84)
>         at
> org.apache.jmeter.gui.tree.JMeterTreeModel.<init>(JMeterTreeModel.jav
> a:88)
>         at org.apache.jmeter.JMeter.startGui(JMeter.java:185)
>         at org.apache.jmeter.JMeter.start(JMeter.java:239)
>         ... 5 more
> 
> Any help is appreciated.
> 
> Thanks
> 
> Yuri Weinstein
> 
> 
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Starting JMeter errors

Posted by Mike Stover <ms...@apache.org>.
I have no idea - my best guess is that your using JDK1.3 and the new code isn't compatible 
with 1.3.

-Mike

On 26 Sep 2002 at 15:48, Yuri Weinstein wrote:

> Hi all,
> 
> I have not used JMeter for a while and downloaded the latest nightly
> build today and tried to run it and got errors:
> 
> BUILD SUCCESSFUL
> Total time: 32 seconds
> C:\jakarta-jmeter>cd bin
> 
> C:\jakarta-jmeter\bin>jmeter
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.jmeter.NewDriver.main(NewDriver.java:181)
> Caused by: java.lang.NoSuchMethodError:
> processSynchronousLightweightTransfer
>         at java.awt.KeyboardFocusManager.initIDs(Native Method)
>         at java.awt.KeyboardFocusManager.<clinit>(Unknown Source)
>         at javax.swing.UIManager.initialize(Unknown Source)
>         at javax.swing.UIManager.maybeInitialize(Unknown Source)
>         at javax.swing.UIManager.getUI(Unknown Source)
>         at javax.swing.JPanel.updateUI(Unknown Source)
>         at javax.swing.JPanel.<init>(Unknown Source)
>         at javax.swing.JPanel.<init>(Unknown Source)
>         at javax.swing.JPanel.<init>(Unknown Source)
>         at org.apache.jmeter.gui.NamePanel.<init>(NamePanel.java:84)
>         at
> org.apache.jmeter.gui.tree.JMeterTreeModel.<init>(JMeterTreeModel.jav
> a:88)
>         at org.apache.jmeter.JMeter.startGui(JMeter.java:185)
>         at org.apache.jmeter.JMeter.start(JMeter.java:239)
>         ... 5 more
> 
> Any help is appreciated.
> 
> Thanks
> 
> Yuri Weinstein
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Usage of _regexFunction

Posted by Wangke Liao <wa...@yahoo-inc.com>.
Hi, Mike and All,

I am wondering whether I can use the same _regexFunctions(x, x, x, x, ,
getID) on multiple page results. The scenario arose in this:

1. Do a search that return a page with a list of 10 (or whatever predefine
number) result items plus a link to browse the next 10 items on the next
page.
2. Click the "Next" link to get the next 10 results, now with links to
browse both previous and next 10 items etc - a very common search result
presentation scheme.
3. Now since all the items' IDs in these pages are what I need for later
loops, I want to use the same getID function in a series of pages to grab
all of them together in one getID function. And use Parameter Mask to loop
through them later.

My question is: when I use the same _regexFunction repeatedly to the
responses from result page to result page, will the $(getID_g#) array keep
appending itself with next set of values, or starting from each result page
it will replace whatever previously stored in getID array with new Ids of
current page instead? I obvious prefer it to keep appending instead of
refreshing itself.

Hope I described the problem clear enough. Any answer is appreciated.

-Wangke


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Usage of _regexFunction

Posted by Wangke Liao <wa...@yahoo-inc.com>.
Thanks, Mike!

Indeed, that does solve the problem. The mistake I made was only using
${getID} instead of using ${getID_g1} - should have easily been avoided, I
know.

-wangke

 -----Original Message-----
From: 	Mike Stover [mailto:mstover1@apache.org]
Sent:	Tuesday, September 24, 2002 12:19 PM
To:	wangke@yahoo-inc.com; jmeter-user@jakarta.apache.org
Subject:	Re: Usage of _regexFunction

Have you read the docs about the regex function?
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#__regex
Function

The function would go in the HTTP Request in the parameter table:
Name		Value
ID		${__regexFunction(xx,xx,xx,xx,,getID)}

*note the extra comma - the regexFunction takes six parameters these days.

Then, to access these values again later:

${getID_g1}  (this means, the first group parsed from the getID
regexFunction - you could
also grab the 0 group, which is the entire match.  You could grab any group
in the regular
expression).

Hope that helps

-Mike

On 24 Sep 2002 at 11:27, Wangke Liao wrote:

> Hi,
>
> I guess I am bit confused on how exactly to use the _regexFunction. I have
> something like this:
>
> Thread group
> 	http req: login
> 	http req: load profile (the response from this req will have some Ids I
am
> looking for in <input hidden name="Id" value= ""> format)
> 	http req: change profile (which needs ID from the response of the last
http
> req)
> 		 name = Id, value = ${_regexFunction(xx,xx,xx,xx, getID) (I use the
> function helper to generate the string)
> 		 .....
> 	http req: update profile
> 		 name = Id, value = ${getID)
> 		 ......
> 	......
>
> Is this the right way to use it. Where exactly should I put the function
and
> what format should I follow to call the function? I probably should put
the
> function right after "http req: load profile", but in which kind of
> component and in which field?
>
> Thanks.
>
> -WK
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Starting JMeter errors

Posted by Yuri Weinstein <yu...@mercedsystems.com>.
Hi all,

I have not used JMeter for a while and downloaded the latest nightly
build today and tried to run it and got errors:

BUILD SUCCESSFUL
Total time: 32 seconds
C:\jakarta-jmeter>cd bin

C:\jakarta-jmeter\bin>jmeter
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.jmeter.NewDriver.main(NewDriver.java:181)
Caused by: java.lang.NoSuchMethodError:
processSynchronousLightweightTransfer
        at java.awt.KeyboardFocusManager.initIDs(Native Method)
        at java.awt.KeyboardFocusManager.<clinit>(Unknown Source)
        at javax.swing.UIManager.initialize(Unknown Source)
        at javax.swing.UIManager.maybeInitialize(Unknown Source)
        at javax.swing.UIManager.getUI(Unknown Source)
        at javax.swing.JPanel.updateUI(Unknown Source)
        at javax.swing.JPanel.<init>(Unknown Source)
        at javax.swing.JPanel.<init>(Unknown Source)
        at javax.swing.JPanel.<init>(Unknown Source)
        at org.apache.jmeter.gui.NamePanel.<init>(NamePanel.java:84)
        at
org.apache.jmeter.gui.tree.JMeterTreeModel.<init>(JMeterTreeModel.jav
a:88)
        at org.apache.jmeter.JMeter.startGui(JMeter.java:185)
        at org.apache.jmeter.JMeter.start(JMeter.java:239)
        ... 5 more

Any help is appreciated.

Thanks

Yuri Weinstein


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Usage of _regexFunction

Posted by Mike Stover <ms...@apache.org>.
Have you read the docs about the regex function? 
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#__regexFunction

The function would go in the HTTP Request in the parameter table:
Name		Value
ID		${__regexFunction(xx,xx,xx,xx,,getID)}

*note the extra comma - the regexFunction takes six parameters these days.

Then, to access these values again later:

${getID_g1}  (this means, the first group parsed from the getID regexFunction - you could 
also grab the 0 group, which is the entire match.  You could grab any group in the regular 
expression).

Hope that helps

-Mike

On 24 Sep 2002 at 11:27, Wangke Liao wrote:

> Hi,
> 
> I guess I am bit confused on how exactly to use the _regexFunction. I have
> something like this:
> 
> Thread group
> 	http req: login
> 	http req: load profile (the response from this req will have some Ids I am
> looking for in <input hidden name="Id" value= ""> format)
> 	http req: change profile (which needs ID from the response of the last http
> req)
> 		 name = Id, value = ${_regexFunction(xx,xx,xx,xx, getID) (I use the
> function helper to generate the string)
> 		 .....
> 	http req: update profile
> 		 name = Id, value = ${getID)
> 		 ......
> 	......
> 
> Is this the right way to use it. Where exactly should I put the function and
> what format should I follow to call the function? I probably should put the
> function right after "http req: load profile", but in which kind of
> component and in which field?
> 
> Thanks.
> 
> -WK
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>