Set

Allows you to set a variable for future uses in the test. For example,  you can save a value retrieved from the response and use it in a subsequent call.

Parameters:

Name Type/Value Required
Var String Yes
Variable mode ‘String’, ‘Object’, ‘Language’ Yes
Value (depends on ‘Variable mode = string’) String Yes
Object (depends on ‘Variable mode = object’) Object Yes
Lang (depends on ‘Variable mode = language’) ‘java’, ‘ruby’ Yes
Content (depends on ‘Variable mode = language’) Object Yes

Var: artistId
Variable mode: String
Value: _1.id

 

Var: sobjects
Variable mode: Object
Object: payload.findAll { it.name == ‘bananas’ }

 

Var: queries
Variable mode: Language
Lang: Java
Content:
if (payload.id>100)
return ‘furniture’