Question

I'd like to practice IF controller basically as follow:

TEST_PLAN

+Thread_group: (user: 3, ramp: 3, loop:2)

+Loop_Controller(loop:4)

++ HTTP request1: go to page_1

+IF_Controller1

++ HTTP request2: go to page_2

++ counter (config element)

+IF_Controller2

++ HTTP request3: click Back button

My condition "HTTP request 2" is only executed if loop (output "Loop_Controller" >4). How to do that ? And, for IF_Controller2: it's will be executed after each of question on this page has checked (page has 5 questions, 1 question has 5 answer radio button.)

I also follow the Counter element and Counter functions, but don't know how to combine them?

and one more things: to use the variable in IF statement, they should be put on previous activities ? (in my case: IF controller: ${count}, thereby variable "count" should be put on HTTP request 1)

Thanks,

Était-ce utile?

La solution

You need to place COUNTER as a child of Loop Controller, not If Controller. In this case you'll get the following scenario:

HTTP Request 1 (loop 1)
HTTP Request 1 (loop 2)
HTTP Request 1 (loop 3)
HTTP Request 1 (loop 4)
** HERE we're getting out of Loop Controller and go to 2nd Loop of Thread Group, If controller doesn't fire as counter value is 4 and condition is >4**
HTTP Request 1 (loop 5)
HTTP Request 1 (loop 6)
HTTP Request 1 (loop 7)
HTTP Request 1 (loop 8)
** HERE counter value is 8 and If controller condition is met so **
HTTP Request 2 

Being child of If Controller counter isn't getting incremented

Counter Configuration:

  • Start: 1
  • Increment: 1
  • Reference Name: N

If Controller Configuration:

${N} > 4

See How to use JMeter's 'IF' Controller and get Pie guide for more details.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top