Randy Lam
Randy Lam

Reputation: 689

use jmeter to load test a site: the url is different every time while running the script

I try to test a site with Jmeter and I used its HTTP Proxy sever to make the script.

Actually, the process of this script is
1. login
2. click a link to another page and fill in some info and click SUBMIT
3. logout.

The problem is: everytime I run the script, everything is going well before hitting the SUBMIT button. 'cuz after hitting it, 8 random numbers or letters will be added to the url. So, everytime i run the script, the url is different from the first time that made the script.

Is there anyone has run into kind of question?

Upvotes: 1

Views: 1091

Answers (1)

BlackGaff
BlackGaff

Reputation: 7707

Couple things to consider:

  1. Are these "random numbers" in the source code, or just the URL as a parameter? If so, see below.
  2. Are they a JSESSION ID? If so - use a cookie manager. That should solve the issue.

If they are in the source code, you'll need to use a regular expression to extract the value. You'll want it as a child of Step2, making your structure:

Login
Form Page
 --- Regex for Submit button
Submit

http://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor

Upvotes: 3

Related Questions