Reputation: 11
Login page is having dynamic password field name: every time user visits the login page field name looks like PASSWORD_673834937
, and on next visit, it looks like PASSWORD_673857943
.
I have created many scripts which were working as of today, but in latest build they bring in this change to the password field... before this it was always PASSWORD
only. So all my scripts were failing. What is the workaround, so that all my scripts start working with dynamic field name?
OLD JMETER SCRIPT using name as "PASSWORD"
NEW changes to the password field
Upvotes: 0
Views: 2428
Reputation: 168217
This is a matter of missing correlation, you would need this sooner or later given you continue playing with JMeter.
The idea of bypassing dynamic parameters is building your Test Plan as follows:
Request 2 (perform login) providing credentials and all dynamic variables from the previous step
Add CSS/JQuery Extractor (be aware that it is not recommended to use regular expressions to work with HTML data) as a child of the register.asp
page and configure it as follows:
name
input[title=Password]
name
PASSWORD_673834937
with ${name}
in the new script. Upvotes: 0
Reputation: 14004
register.asp
sampler, add RegEx Post-ProcessorSpecify the following parameters:
(i.e. the regular expression is <input TYPE="password" NAME="([^"]+)"
)
In HTTP Request, in the row where password is provided, specify variable created by RegEx Post-Processor in Field name, instead of static name. For example, since the variable I created above is called PasswordFieldName
, the HTTP Sampler should look like this (omitting irrelevant parameters):
Upvotes: 1