Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
366 views
by The go-to Tester (190 points)
retagged by
Hi,

By Record Script option i record the process of login into a webpage

After the record script is completed, i try to run the process in jmeter, But when i run the process it's not entering into the webpage (i,e login fails), Then i copied the api of login functionality

and generate the token and i created HTTP Header Manager and i added

"TOKEN"

"Authorization"   "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImFsbEBuYWFuYWwuaW4iLCJ1c2VybmFtZSI6ImFsbCIsImV4cCI6MTUxNTc0MzA1MSwidXNlcl9pZCI6MzB9.GNoUVKT8aYhpKCLIyct-8h2YmIBrGqgbRkoiUH2AUDs"

after adding this i run the process it successfully login into the application.

My Qus is

1) This is the correct way or there's some other way ?

2) how to create multiple user's with different login ?

1 Answer

2 like 0 dislike
by Expert (748 points)
selected by
 
Best answer
Your application have some authentication

not an issue sometime token is required and you add in your script.Sometime, certificate also required which you have to add in setting

Now, come to your question,

1> Yes, this is correct way, if your application have provide some authentication , you can easily ask to developer it they remove it or not,If not then you have to add token

>> use corelation -add -regular expression extractor

2>For multiple user with different login , you have to use parametrization (thread group-add- csv data set config file)

>>In which you add user with different username & password and save it in bin folder of your apache jmeter software and pass the directory url in "csv data set config"  and when you make script note down you have to user same username & password.
by The go-to Tester (190 points)
Thank you @Bharat
I will try this one and let you know ..
by Expert (748 points)
Sure, its definitely work it
by The go-to Tester (190 points)
@Bharat
It's working fine ..
But  instead of using regular expression extractor i use json  extractor to get the token
I config csv data for multiple user's
Thanks for your help .
by Expert (748 points)
Good, now your script work fine
by The go-to Tester (190 points)
yeah .........
working fine ....


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...