How to pass a random User/Pass (for Basic Authentication) with JMeter? -


I am using Jmeter to test an API. I have got set up the Basic Authentication - It's working well.

Now, I'm trying to make credentials random JMM cross wire Therefore, in two ways I know that I can do this.

  1. Add a custom HTTP header (via a HTTP header manager element ) and then in random areas (i read from csv file Is set)
  2. Use the HTTP Authorization Manager element and pass in the username and password.

Now, if I try and use the above method (1), then I need to create the following headers / data: -

  Authorization: Original & lt; Some Base 64 Encoded String Formats Username: Password & gt; like. Authorization: Original ONXXOnBH3MX  

Only simple. But the value of that header is not exceeding in the wire :( I can add any other header type and it is crossed in the wire ..

Hmm .. ok then .. try Method (2). / P>

Now it works .. But I can only do hardcode in the username and password. I can not see that I use the username VARIABLE (i.e. $ {usernmae} ) or a password different (i.e.. $ {password} ). The server is right Page / data gives the right answer.

So .. Can anyone please help?

  1. Create an HTTP Authorization Manager element
  2. Set the username and password to the variable, $ $ {username}, set to {password}
  3. Create a CSV file with your user names and passwords (do not use the header row)
  4. Create a CSV Data Set Config Element, "From Username With variable variable names, the password "(no quote, and no spack is
  5. Each thread / loop will read a different value from the CSV file. Alternatively, if you want the value to be randomly logged in, there are some functions that you can generate random numbers or send at the time of execution.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -