You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Sander A. Smith" <sm...@sericontech.com> on 2009/09/29 19:00:30 UTC

Replacing Selenium with JMeter within a Java application

I have a Java application that I'm using to drive tests that's based on
Selenium. I record the test with Selenium IDE, and then spit the test out as
Java code that I compile into my application. My tests consist of visiting
several web pages, and as the test progresses, the next page visited may be
determined by the contents of the current page. All of the statistics I need
for timing are handled by my application.

I'm finding that Selenium is not as scalable as my needs dictate, and I'm
considering replacing it with JMeter since it's so much faster and scalable.
However, I'm having a hard time finding the right documentation to determine
if it will meet my needs.

I've played around with JMeter and see that it works great recording my test
as a .jmx file. I'd like to now take this .jmx file and replay it through my
application. I've looked through the JMeter JavaDoc, but can't quite figure
out where to start. I want to issue a command to load a page, and then based
on what's in that page, issue a command to load another page, etc.
Anyone have any ideas or examples for how to do this?

-- 
Sander A. Smith
President

Sericon Technology Inc.
71 Marquette Ave.
Toronto, Ontario M6A 1X8
(416)781-3988

Link to me on LinkedIn
www.linkedin.com/in/sandersmith

Learn about enterprise security for home-based servers
www.autossl.com

www.sericontech.com

Re: Replacing Selenium with JMeter within a Java application

Posted by Deepak Shetty <sh...@gmail.com>.
if you wish to run a HTTP test as part of some other application , you
should consider a different tool . Jmeter works as a stand alone
application.
e.g. TestNG(for the threading) + jwebunit might work for you
Im pretty sure there are a bunch of other web testing tools as well
regards
deepak

On Tue, Sep 29, 2009 at 10:00 AM, Sander A. Smith
<sm...@sericontech.com>wrote:

> I have a Java application that I'm using to drive tests that's based on
> Selenium. I record the test with Selenium IDE, and then spit the test out
> as
> Java code that I compile into my application. My tests consist of visiting
> several web pages, and as the test progresses, the next page visited may be
> determined by the contents of the current page. All of the statistics I
> need
> for timing are handled by my application.
>
> I'm finding that Selenium is not as scalable as my needs dictate, and I'm
> considering replacing it with JMeter since it's so much faster and
> scalable.
> However, I'm having a hard time finding the right documentation to
> determine
> if it will meet my needs.
>
> I've played around with JMeter and see that it works great recording my
> test
> as a .jmx file. I'd like to now take this .jmx file and replay it through
> my
> application. I've looked through the JMeter JavaDoc, but can't quite figure
> out where to start. I want to issue a command to load a page, and then
> based
> on what's in that page, issue a command to load another page, etc.
> Anyone have any ideas or examples for how to do this?
>
> --
> Sander A. Smith
> President
>
> Sericon Technology Inc.
> 71 Marquette Ave.
> Toronto, Ontario M6A 1X8
> (416)781-3988
>
> Link to me on LinkedIn
> www.linkedin.com/in/sandersmith
>
> Learn about enterprise security for home-based servers
> www.autossl.com
>
> www.sericontech.com
>

Re: Replacing Selenium with JMeter within a Java application

Posted by sebb <se...@gmail.com>.
On 29/09/2009, Sander A. Smith <sm...@sericontech.com> wrote:
> I have a Java application that I'm using to drive tests that's based on
>  Selenium. I record the test with Selenium IDE, and then spit the test out as
>  Java code that I compile into my application. My tests consist of visiting
>  several web pages, and as the test progresses, the next page visited may be
>  determined by the contents of the current page. All of the statistics I need
>  for timing are handled by my application.
>
>  I'm finding that Selenium is not as scalable as my needs dictate, and I'm
>  considering replacing it with JMeter since it's so much faster and scalable.
>  However, I'm having a hard time finding the right documentation to determine
>  if it will meet my needs.
>
>  I've played around with JMeter and see that it works great recording my test
>  as a .jmx file. I'd like to now take this .jmx file and replay it through my
>  application. I've looked through the JMeter JavaDoc, but can't quite figure
>  out where to start. I want to issue a command to load a page, and then based
>  on what's in that page, issue a command to load another page, etc.
>  Anyone have any ideas or examples for how to do this?

JMeter is a standalone application, not a library.

You can call it from Java (that's how the Ant-JMeter task works) but
it will run the whole JMX file.

If you really need to embed the processing within your application,
then you need to use an HTTP library such as Apache HttpComponents
HttpClient - see http://hc.apache.org/httpcomponents-client/index.html

JMeter itself uses an earlier version of this (and will be migrating
to the current version at some point).

However, perhaps you can use JMeter to gather the raw timing data and
then process that in your application.

>  --
>  Sander A. Smith
>  President
>
>  Sericon Technology Inc.
>  71 Marquette Ave.
>  Toronto, Ontario M6A 1X8
>  (416)781-3988
>
>  Link to me on LinkedIn
>  www.linkedin.com/in/sandersmith
>
>  Learn about enterprise security for home-based servers
>  www.autossl.com
>
>  www.sericontech.com
>

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