1

i'm trying to implement a test plan using JMeter.

I want to do the following scenario: in the same thread i have 2 HTTP Request

HTTP Request login
HTTP Request getStudentsName

the thing is HTTP Request getStudentsName can't be done unless i run the login first , so lets say i want to do the login for 1 user and then getStudentsName for 50 users.

if i put the login and getStudentsName in 2 different threads login give a success but the getStudentsName failed.

My question is can i implement this example in the same thread?or any other help?

Thanks.

elie
  • 197
  • 2
  • 13

2 Answers2

1

To run login only once use Once Only Controller as its parent by right click, Insert Parent on the UI.

The Once Only Logic Controller tells JMeter to process the controller(s) inside it only once per Thread, and pass over any requests under it during further iterations through the test plan.

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • thank you @useuser7294900 it works for me ,but i have one question , the only once controller work with loop count not number of threads(user) as i have seen in examples, so is the performance of (100 loop count + 1 user) is the same as (100 users + 1 loop count)? – elie Feb 23 '18 at 15:42
  • It depends, but users should be faster because it can execute in parallel. For more details ask a new question – Ori Marko Feb 23 '18 at 16:31
0

You can use in the same thread group, Config Elements like HTTP Authorization Manager or HTTP Header Manager depending on what exactly the login implies.

isus hristos
  • 130
  • 1
  • 9