JMeter - Looping

103 Views Asked by At

I have the following script with 1 thread and 2 iterations. enter image description here

enter image description here

Debug in Switch is not called. The second Google in the first iteration and the second Yahoo in the second iteration are not executed. Why?
Thank you for the help.

I added the image of Switch Controller. enter image description here
Google and Yahoo are Simple Controllers with one HTTP Request Sampler.

2

There are 2 best solutions below

1
On BEST ANSWER

Remove spaces in the Domains.csv file in the second column. As of now action= Google is checked instead of action=Google. so the behaviour.

Domains.csv

domain_1,domain_2
Google,Google
Yahoo,Yahoo

Note: As you are using Switch Controller, it executes only matching element inside of it.

Debug Sampler in Switch element will never be matched as you are looking for either Google or Yahoo.

As Edi Prayitno mentioned, you can keep it inside the Simple Controller, if you want to execute Debug Sampler in Switch every time.

1
On

enter image description here Based on the help of Switch Controller above, you put the Switch Value = ${action}. It means you filled the Switch Value with the name of the subordinate element. When ${action} name = Google, it will execute subordinate element = Google. When ${action} = Yahoo, it will execute subordinate element name = Yahoo.That means Debug in Switch will be never be called.

If you want to put debug step inside of Switch Controller, you can re-arrange your test as below: enter image description here

I hope that helps you.