Srikanth Yadake
Srikanth Yadake

Reputation: 573

Condition in 'if' Logic controller jmeter

'if' controller is skipped.

I need to check size of contents in a variable, and if size > 0 action should be taken

 ${__groovy(${WorkflowActivities}.size() > 0)}

This is the condition added in if controller

But if controller is not working

Upvotes: 0

Views: 546

Answers (2)

Ori Marko
Ori Marko

Reputation: 58774

EDIT

Although below condition works for me, try a "Java" version

${__groovy(Integer.parseInt(vars.get("WorkflowActivities"))  > 0)}

I think your value is a number saved as String when extract from JSON. So you just need to convert it:

${__groovy(vars.get("WorkflowActivities") as int  > 0)}

Upvotes: 3

Iske
Iske

Reputation: 1200

Try with this function, it should work.

${__groovy(vars.get("WorkflowActivities").size() > 0)}

For more references, please check this link.

Upvotes: 1

Related Questions