You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Oliver Erlewein [DATACOM]" <Ol...@datacom.co.nz> on 2009/06/22 03:22:27 UTC

Scraping data from a webpage for use in test

Hi all,

I have an problem and was wondering if someone had an elegant solution out there. 

I've got a website that I need to perf test and for that I need to logon with a one-time password. These one-time passwords are listed on another web page. How do I elegantly scrape all the one-time passwords from the web page and use them in my JMeter threads? I am aware I can use Regex but we're talking 100's and 1000's of one-time passwords. These are also not available as a CSV before the test. I need to generate them when the test starts. 

Thanks!
Oliver

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


Re: Scraping data from a webpage for use in test

Posted by sebb <se...@gmail.com>.
On 22/06/2009, Oliver Erlewein [DATACOM] <Ol...@datacom.co.nz> wrote:
> Hi all,
>
>  I have an problem and was wondering if someone had an elegant solution out there.
>
>  I've got a website that I need to perf test and for that I need to logon with a one-time password. These one-time passwords are listed on another web page. How do I elegantly scrape all the one-time passwords from the web page and use them in my JMeter threads? I am aware I can use Regex but we're talking 100's and 1000's of one-time passwords. These are also not available as a CSV before the test. I need to generate them when the test starts.

Sounds like the passwords are shared between the threads, in which
case I would try to create a CSV file from the page. You say that the
passwords are not available as a CSV before the test, but the web-page
must surely be available immediately prior to the test otherwise how
can you start testing?

If the page is well laid out, this should be fairly easy with a
scripting language; for example Perl and Python can both read HTTP and
process the response.

It's going to be quite expensive in resources if all the passwords
have to be held in memory, as would be the case when using Regex or
XPath Extractor. Also, the variables created by these will only be
available to the same thread, which may not be what you want.

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

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