You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by sebb <se...@gmail.com> on 2009/11/13 18:41:40 UTC

Re: How can I develop Java classes, to prepare and execute a .jmx file (JMeter scenario) and retrieve wanted texts from its response?

On 13/11/2009, rosiere <sh...@gmail.com> wrote:
>
>  Hello,
>
>  I would like to develop a Java application, that executes a predefined
>  jmeter test
>
>  scenario, to programmatically send http requests towards a web application
>  on Internet,
>
>  and retrieve some wanted texts from the HTTP response.
>
>  To do this, I need to make a jmx by JMeter's GUI interface, then, tag its
>  HTTP
>
>  parameters. and My Java app will parse the jmx file, replace the tags by
>  real values,
>
>  then execute the jmx and retrieve results.
>
>  The final goal, is to submit programmatically HTML forms, that request a
>  credit
>
>  report from some credit rating agencies' Internet applications. These
>  agencies haven't
>
>  developed any distributed IT services (neither EJB nor Web Services) for
>  such a
>
>  purpose, and they plan to release a web service for requesting credit
>  report, but only
>
>  in late 2010.
>
>
>  For example, this is a paragraph from my jmx file template that logs into an
>  credit
>
>  agency's web app with a login and a password: I shall replace
>  programmatically @LOGIN
>
>  and @PASSWORD with real credentials in my application, then generate a new
>  jmx and
>
>  execute it, and at last, run programmatically the new jmx and retrieve
>  results (such as the id, date,
>
>  content of a credit report). (The same process is only manually available on
>  the credit
>
>  agency's web app, and I would  like to run it programmatically from a Java
>  app.)
>
>
>  <elementProp name="login" elementType="HTTPArgument">
>  <boolProp name="HTTPArgument.always_encode">false</boolProp>
>  <stringProp name="Argument.value">@LOGIN</stringProp>
>  <stringProp name="Argument.metadata">=</stringProp>
>  <boolProp name="HTTPArgument.use_equals">true</boolProp>
>  <stringProp name="Argument.name">login</stringProp>
>  </elementProp>
>
>
>  <elementProp name="password" elementType="HTTPArgument">
>  <boolProp name="HTTPArgument.always_encode">false</boolProp>
>  <stringProp name="Argument.value">@PASSWORD</stringProp>
>  <stringProp name="Argument.metadata">=</stringProp>
>  <boolProp name="HTTPArgument.use_equals">true</boolProp>
>  <stringProp name="Argument.name">password</stringProp>
>  </elementProp>
>
>
>
>  Could you tell me how to achieve this goal and where can I find some
>  examples that
>
>  works in a similar way?
>
>  Thanks a lot.

This is not a suitable application for JMeter; it will involve a lot
of unnecessary work.

You would be much better off using a Java HTTP library such as Apache
HttpClient (http://hc.apache.org/httpcomponents-client/index.html) or
perhaps HttpUnit (http://httpunit.sourceforge.net/)

>  With my best wishes,
>
>  Rosière
>
> --
>  View this message in context: http://old.nabble.com/How-can-I-develop-Java-classes%2C-to-prepare-and-execute-a-.jmx-file-%28JMeter-scenario%29-and-retrieve-wanted-texts-from-its-response--tp26339888p26339888.html
>  Sent from the JMeter - Dev mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>

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


Re: How can I develop Java classes, to prepare and execute a .jmx file (JMeter scenario) and retrieve wanted texts from its response?

Posted by sebb <se...@gmail.com>.
On 13/11/2009, rosiere <sh...@gmail.com> wrote:
>
>  Hello,
>
>  I did find JMeter's API rich and complex.
>
>  However the example I explained (login & password) is just a simplified
>  scenario.
>
>  In fact, it may take a long time (up to several hours) to retrieve a credit
>  report, so I need an asynchronous mechanism, between my j2ee web app (I
>  forgot to explain that it should be a j2ee web app) and credit agencies' web
>  app.

JMeter assumes synchronous requests, so this would be another difficulty.

>  Besides, the way of searching conclusion in a credit report in HTML, is
>  specific to each credit agency, and I would like to code them in different
>  "use cases", and use the JMeter's variable and regular expression extractor
>  to retrieve the credit report id, its issue date and its status (accepted or
>  refused), and at last store them in the database that backs also my j2ee web
>  app.
>
>  Given these requirements, should I use JMeter or simply a pure simple Java
>  HTTP client, and what examples in JMeter can I learn from, in order to
>  fullfill these requirements?
>

Again: this is not a suitable use for JMeter.

>
>  "This is not a suitable application for JMeter; it will involve a lot
>  of unnecessary work.
>
>  You would be much better off using a Java HTTP library such as Apache
>  HttpClient (http://hc.apache.org/httpcomponents-client/index.html) or
>  perhaps HttpUnit (http://httpunit.sourceforge.net/)"
>
>  "
>
> >  For example, this is a paragraph from my jmx file template that logs into
>  > an
>  >  credit
>  >
>  >  agency's web app with a login and a password: I shall replace
>  >  programmatically @LOGIN
>  >
>  >  and @PASSWORD with real credentials in my application, then generate a
>  > new
>  >  jmx and
>  >
>  >  execute it, and at last, run programmatically the new jmx and retrieve
>  >  results (such as the id, date,
>  >
>  >  content of a credit report). (The same process is only manually available
>  > on
>  >  the credit
>  >
>  >  agency's web app, and I would  like to run it programmatically from a
>  > Java
>  >  app.) "
>
> >  With my best wishes,
>  >
>  >  Rosière
>  >
>  > --
>  >  View this message in context:
>  > http://old.nabble.com/How-can-I-develop-Java-classes%2C-to-prepare-and-execute-a-.jmx-file-%28JMeter-scenario%29-and-retrieve-wanted-texts-from-its-response--tp26339888p26339888.html
>  >  Sent from the JMeter - Dev mailing list archive at Nabble.com.
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>  >  For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>  >
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>
>
>
>
> --
>  View this message in context: http://old.nabble.com/How-can-I-develop-Java-classes%2C-to-prepare-and-execute-a-.jmx-file-%28JMeter-scenario%29-and-retrieve-wanted-texts-from-its-response--tp26339888p26341800.html
>
> Sent from the JMeter - Dev mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>

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


Re: How can I develop Java classes, to prepare and execute a .jmx file (JMeter scenario) and retrieve wanted texts from its response?

Posted by rosiere <sh...@gmail.com>.
Hello,

I did find JMeter's API rich and complex.

However the example I explained (login & password) is just a simplified
scenario.

In fact, it may take a long time (up to several hours) to retrieve a credit
report, so I need an asynchronous mechanism, between my j2ee web app (I
forgot to explain that it should be a j2ee web app) and credit agencies' web
app.

Besides, the way of searching conclusion in a credit report in HTML, is
specific to each credit agency, and I would like to code them in different
"use cases", and use the JMeter's variable and regular expression extractor
to retrieve the credit report id, its issue date and its status (accepted or
refused), and at last store them in the database that backs also my j2ee web
app.

Given these requirements, should I use JMeter or simply a pure simple Java
HTTP client, and what examples in JMeter can I learn from, in order to
fullfill these requirements?


"This is not a suitable application for JMeter; it will involve a lot
of unnecessary work.

You would be much better off using a Java HTTP library such as Apache
HttpClient (http://hc.apache.org/httpcomponents-client/index.html) or
perhaps HttpUnit (http://httpunit.sourceforge.net/)"

"
>  For example, this is a paragraph from my jmx file template that logs into
> an
>  credit
>
>  agency's web app with a login and a password: I shall replace
>  programmatically @LOGIN
>
>  and @PASSWORD with real credentials in my application, then generate a
> new
>  jmx and
>
>  execute it, and at last, run programmatically the new jmx and retrieve
>  results (such as the id, date,
>
>  content of a credit report). (The same process is only manually available
> on
>  the credit
>
>  agency's web app, and I would  like to run it programmatically from a
> Java
>  app.) "
>  With my best wishes,
>
>  Rosière
>
> --
>  View this message in context:
> http://old.nabble.com/How-can-I-develop-Java-classes%2C-to-prepare-and-execute-a-.jmx-file-%28JMeter-scenario%29-and-retrieve-wanted-texts-from-its-response--tp26339888p26339888.html
>  Sent from the JMeter - Dev mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>

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




-- 
View this message in context: http://old.nabble.com/How-can-I-develop-Java-classes%2C-to-prepare-and-execute-a-.jmx-file-%28JMeter-scenario%29-and-retrieve-wanted-texts-from-its-response--tp26339888p26341800.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.


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