You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bharti Munjal <bh...@drishti-soft.com> on 2012/04/25 11:53:53 UTC

Asynchronous requests in jmeter??

Can we send an asynchronous request in jmeter?

-- 

Bharti Munjal
Software Developer, RnD


  DRISHTI-SOFT SOLUTIONS PVT. LTD.

 GP 62-A, Sector-18, Gurgaon-122016

 Tel.: +91-124-4771000

 Fax: +91-124-4039120 | Cell: +91-9717953933

 Website:  <http://www.drishti-soft.com/>www.drishti-soft.com |
<http://www.ameyosuite.com/>
www.ameyosuite.com

Awards & Recognitions<http://www.drishti-soft.com/drishti_awards_recognition.php>
:

NASSCOM Innovation Awards 2008 for Market Facing Innovation | Pioneers in
IP Contact Center Technology by TMCNet (2008) |  Best ACD/Switch, Best
Outbound Solution and after Sales Support By Contact Center World
(APAC-2008) | Best Contact Center Suite by BPO News (2007)| Deloitte Fast
500 company in APAC | Red Herring Top 100 (2008) | NASSCOM - EMERGE 50 (
2009) | IT & ITES Business of the Year by Franchise India, E&Y and Zee
Business (2010) | Red Herring Asia Top 100 Winner (2010) | Best Contact
Center Technology Platform by Insights’ MECC (2011)

__________________________________________________________

Please read Disclaimer
-(http://www.drishti-soft.com/disclaimer.php<http://www.google.com/url?q=http%3A%2F%2Fwww.drishti-soft.com%2Fdisclaimer.php&sa=D&sntz=1&usg=AFQjCNHgw6LB0Uv5Qy4CQJh4bP4GouKNqg>
)

Re: Asynchronous requests in jmeter??

Posted by Deepak Shetty <sh...@gmail.com>.
Yes (thats what having more than one thread does) But thats probably not
what you wanted to ask.
Assuming you mean testing AJAX websites then --
http://theworkaholic.blogspot.com/2010/11/jmeter-and-ajax-part-i.html +
search for multiple threads on this mail archive.

On Wed, Apr 25, 2012 at 2:53 AM, Bharti Munjal <
bhartimunjal@drishti-soft.com> wrote:

> Can we send an asynchronous request in jmeter?
>
> --
>
> Bharti Munjal
> Software Developer, RnD
>
>
>  DRISHTI-SOFT SOLUTIONS PVT. LTD.
>
>  GP 62-A, Sector-18, Gurgaon-122016
>
>  Tel.: +91-124-4771000
>
>  Fax: +91-124-4039120 | Cell: +91-9717953933
>
>  Website:  <http://www.drishti-soft.com/>www.drishti-soft.com |
> <http://www.ameyosuite.com/>
> www.ameyosuite.com
>
> Awards & Recognitions<
> http://www.drishti-soft.com/drishti_awards_recognition.php>
> :
>
> NASSCOM Innovation Awards 2008 for Market Facing Innovation | Pioneers in
> IP Contact Center Technology by TMCNet (2008) |  Best ACD/Switch, Best
> Outbound Solution and after Sales Support By Contact Center World
> (APAC-2008) | Best Contact Center Suite by BPO News (2007)| Deloitte Fast
> 500 company in APAC | Red Herring Top 100 (2008) | NASSCOM - EMERGE 50 (
> 2009) | IT & ITES Business of the Year by Franchise India, E&Y and Zee
> Business (2010) | Red Herring Asia Top 100 Winner (2010) | Best Contact
> Center Technology Platform by Insights’ MECC (2011)
>
> __________________________________________________________
>
> Please read Disclaimer
> -(http://www.drishti-soft.com/disclaimer.php<
> http://www.google.com/url?q=http%3A%2F%2Fwww.drishti-soft.com%2Fdisclaimer.php&sa=D&sntz=1&usg=AFQjCNHgw6LB0Uv5Qy4CQJh4bP4GouKNqg
> >
> )
>

Re: iframes and jmeter

Posted by ll...@oreillyauto.com.
Philippe Mouawad <ph...@gmail.com> wrote on 04/26/2012 01:53:38
PM:

> From: Philippe Mouawad <ph...@gmail.com>
> To: JMeter Users List <us...@jmeter.apache.org>
> Date: 04/26/2012 02:00 PM
> Subject: Re: iframes and jmeter
>
> Hello,
> I confirm that iframe are followed at least since 2.5.1.
> Which version are you using ?

It is following them now. I had some configuration issues with my test, but
after fixing those and restarting jmeter it is working.


Lee Lowder

This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: beanshell post processor question

Posted by Deepak Shetty <sh...@gmail.com>.
http://theworkaholic.blogspot.com/2011/08/random-value-selection-in-xpath.html


On Thu, Apr 26, 2012 at 12:24 PM, <ll...@oreillyauto.com> wrote:

> I have a script I have written in a beanshell processor.
>
> What I need to do is select a random integer (we'll call it X) between 1
> and someVar_matchNr (where someVar is generated by a regex extractor
> earlier)
> Then select X random matches from someVar.
>
> The code I have is:
>
> Integer maxLabels = Integer.parseInt( vars.get
> ("otl_Label_List_All_matchNr"));
> int numLabelsToRequest = __Random(1, maxLabels));
>
> for(int i=1; i<=numLabelsToRequest; i++) {
>  sampler.addArgument("selectedLabels", vars.get(${__V(otl_Label_List_All_$
> {__Random(1,maxLabels)}_g1)}));
> }
>
>
> This code works, as long as I replace all references to "maxLabels" with a
> hard coded number.
>
> Is there a different random number generator I should use, or do I need to
> escape the maxLabels somehow?
>
> As it is written, this code is generating a
> java.lang.NumberFormatException, which is telling me that it is trying to
> treat maxLabels as a literal string (I think).
>
>
> Any suggestions is greatly appreciated.
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: beanshell post processor question

Posted by Deepak Shetty <sh...@gmail.com>.
>int numLabelsToRequest = __Random(1,maxLabels);
I believe you forget to use ${__Random(1,maxLabels)}

On Thu, Apr 26, 2012 at 12:47 PM, <ll...@oreillyauto.com> wrote:

> Comments inline, as I have partially answered my own question, and ran into
> some different problems.
>
> llowder@oreillyauto.com wrote on 04/26/2012 02:24:49 PM:
>
> >
> > I have a script I have written in a beanshell processor.
> >
> > What I need to do is select a random integer (we'll call it X) between 1
> > and someVar_matchNr (where someVar is generated by a regex extractor
> > earlier)
> > Then select X random matches from someVar.
> >
> > The code I have is:
> >
>
> Updated code:
>
> int maxLabels = Integer.parseInt( vars.get("otl_Label_List_All_matchNr"));
> int numLabelsToRequest = __Random(1,maxLabels);
>
> for(int i=1; i<=numLabelsToRequest; i++) {
>  sampler.addArgument("selectedLabels", vars.get(__V("otl_Label_List_All_" +
> __Random(1,Integer.parseInt(maxLabels)) + "_g1")));
> }
>
>
> >
> > This code works, as long as I replace all references to "maxLabels" with
> a
> > hard coded number.
>
> It now will not stacktrace as soon as I start the test, but I do see this
> error in my logs now.
>
> 2012/04/26 14:44:07 ERROR - jmeter.util.BeanShellInterpreter: Error
> invoking bsh method: eval       Sourced file: inline evaluation of: ``int
> maxLabels = Integer.parseInt( vars.get("otl_Label_List_All_matchNr")); int
> n . . . '' : Typed variable declaration : Command not found: __Random( int,
> int )
> 2012/04/26 14:44:07 WARN  - jmeter.modifiers.BeanShellPreProcessor: Problem
> in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking
> bsh method: eval        Sourced file: inline evaluation of: ``int
> maxLabels =
> Integer.parseInt( vars.get("otl_Label_List_All_matchNr")); int n . . . '' :
> Typed variable declaration : Command not found: __Random( int, int )
>
> >
> > Is there a different random number generator I should use?
>
> This question, or at least the first part of still stands.
>
>
> > Any suggestions is greatly appreciated.
> >
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: beanshell post processor question

Posted by ll...@oreillyauto.com.
Comments inline, as I have partially answered my own question, and ran into
some different problems.

llowder@oreillyauto.com wrote on 04/26/2012 02:24:49 PM:

>
> I have a script I have written in a beanshell processor.
>
> What I need to do is select a random integer (we'll call it X) between 1
> and someVar_matchNr (where someVar is generated by a regex extractor
> earlier)
> Then select X random matches from someVar.
>
> The code I have is:
>

Updated code:

int maxLabels = Integer.parseInt( vars.get("otl_Label_List_All_matchNr"));
int numLabelsToRequest = __Random(1,maxLabels);

for(int i=1; i<=numLabelsToRequest; i++) {
 sampler.addArgument("selectedLabels", vars.get(__V("otl_Label_List_All_" +
__Random(1,Integer.parseInt(maxLabels)) + "_g1")));
}


>
> This code works, as long as I replace all references to "maxLabels" with
a
> hard coded number.

It now will not stacktrace as soon as I start the test, but I do see this
error in my logs now.

2012/04/26 14:44:07 ERROR - jmeter.util.BeanShellInterpreter: Error
invoking bsh method: eval	Sourced file: inline evaluation of: ``int
maxLabels = Integer.parseInt( vars.get("otl_Label_List_All_matchNr")); int
n . . . '' : Typed variable declaration : Command not found: __Random( int,
int )
2012/04/26 14:44:07 WARN  - jmeter.modifiers.BeanShellPreProcessor: Problem
in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking
bsh method: eval	Sourced file: inline evaluation of: ``int maxLabels =
Integer.parseInt( vars.get("otl_Label_List_All_matchNr")); int n . . . '' :
Typed variable declaration : Command not found: __Random( int, int )

>
> Is there a different random number generator I should use?

This question, or at least the first part of still stands.


> Any suggestions is greatly appreciated.
>

Lee Lowder

This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: beanshell post processor question

Posted by Shaba K <sh...@gmail.com>.
hey there,

Have a look at this

http://automationwithselenium.blogspot.co.uk/2012/02/how-to-build-request-dynamically-in.html


On Thu, Apr 26, 2012 at 8:24 PM, <ll...@oreillyauto.com> wrote:

> I have a script I have written in a beanshell processor.
>
> What I need to do is select a random integer (we'll call it X) between 1
> and someVar_matchNr (where someVar is generated by a regex extractor
> earlier)
> Then select X random matches from someVar.
>
> The code I have is:
>
> Integer maxLabels = Integer.parseInt( vars.get
> ("otl_Label_List_All_matchNr"));
> int numLabelsToRequest = __Random(1, maxLabels));
>
> for(int i=1; i<=numLabelsToRequest; i++) {
>  sampler.addArgument("selectedLabels", vars.get(${__V(otl_Label_List_All_$
> {__Random(1,maxLabels)}_g1)}));
> }
>
>
> This code works, as long as I replace all references to "maxLabels" with a
> hard coded number.
>
> Is there a different random number generator I should use, or do I need to
> escape the maxLabels somehow?
>
> As it is written, this code is generating a
> java.lang.NumberFormatException, which is telling me that it is trying to
> treat maxLabels as a literal string (I think).
>
>
> Any suggestions is greatly appreciated.
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

beanshell post processor question

Posted by ll...@oreillyauto.com.
I have a script I have written in a beanshell processor.

What I need to do is select a random integer (we'll call it X) between 1
and someVar_matchNr (where someVar is generated by a regex extractor
earlier)
Then select X random matches from someVar.

The code I have is:

Integer maxLabels = Integer.parseInt( vars.get
("otl_Label_List_All_matchNr"));
int numLabelsToRequest = __Random(1, maxLabels));

for(int i=1; i<=numLabelsToRequest; i++) {
 sampler.addArgument("selectedLabels", vars.get(${__V(otl_Label_List_All_$
{__Random(1,maxLabels)}_g1)}));
}


This code works, as long as I replace all references to "maxLabels" with a
hard coded number.

Is there a different random number generator I should use, or do I need to
escape the maxLabels somehow?

As it is written, this code is generating a
java.lang.NumberFormatException, which is telling me that it is trying to
treat maxLabels as a literal string (I think).


Any suggestions is greatly appreciated.

Lee Lowder

This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: iframes and jmeter

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
I confirm that iframe are followed at least since 2.5.1.
Which version are you using ?

Regards
Philippe M.
http://www.ubik-ingenierie.com

On Thu, Apr 26, 2012 at 8:49 PM, Shmuel Krakower <sh...@gmail.com> wrote:

> Hi,
> Checking retrieve all embeded resources should follow frames for sure. If
> you see IFrames are not being followed, open a ticket for this.
>
> Shmuel.
> בתאריך 2012 4 25 17:45, מאת <ll...@oreillyauto.com>:
>
> > The app that I am using makes heavy use of iframes. I have checked the
> > "Retrieve All Embedded Resources from HTML Files", and I changed the HTML
> > parser to the regexp one. The test was recorded using the proxy, but no
> > request was made for the iframe content.
> >
> > I know I can use a post processor to extract the iframe link and then use
> > that to make the request, but is there an easy way make jmeter fetch that
> > frame content - even if the exact number of frames isn't known until
> > runtime?
> >
> > Lee Lowder
> >
> > This communication and any attachments are confidential, protected by
> > Communications Privacy Act 18 USCS § 2510, solely for the use of the
> > intended recipient, and may contain legally privileged material. If you
> are
> > not the intended recipient, please return or destroy it immediately.
> Thank
> > you.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
> >
>



-- 
Cordialement.
Philippe Mouawad.

Re: iframes and jmeter

Posted by Shmuel Krakower <sh...@gmail.com>.
Hi,
Checking retrieve all embeded resources should follow frames for sure. If
you see IFrames are not being followed, open a ticket for this.

Shmuel.
בתאריך 2012 4 25 17:45, מאת <ll...@oreillyauto.com>:

> The app that I am using makes heavy use of iframes. I have checked the
> "Retrieve All Embedded Resources from HTML Files", and I changed the HTML
> parser to the regexp one. The test was recorded using the proxy, but no
> request was made for the iframe content.
>
> I know I can use a post processor to extract the iframe link and then use
> that to make the request, but is there an easy way make jmeter fetch that
> frame content - even if the exact number of frames isn't known until
> runtime?
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

iframes and jmeter

Posted by ll...@oreillyauto.com.
The app that I am using makes heavy use of iframes. I have checked the
"Retrieve All Embedded Resources from HTML Files", and I changed the HTML
parser to the regexp one. The test was recorded using the proxy, but no
request was made for the iframe content.

I know I can use a post processor to extract the iframe link and then use
that to make the request, but is there an easy way make jmeter fetch that
frame content - even if the exact number of frames isn't known until
runtime?

Lee Lowder

This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Asynchronous requests in jmeter??

Posted by venkatakurathi <ve...@hotmail.com>.
This thread might answer your question
http://jmeter.512774.n5.nabble.com/how-to-simulate-asynchronous-calls-td5653677.html

-----
Venkat Akurathi
91-9703186688
--
View this message in context: http://jmeter.512774.n5.nabble.com/Asynchronous-requests-in-jmeter-tp5664372p5664612.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org