Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.

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’, ‘Data’, ‘Language’ Yes
Value (depends on ‘Variable mode = string’) String Yes
Data (depends on ‘Variable mode = data’) Data Yes
Lang (depends on ‘Variable mode = language’) ‘Groovy’ Yes
Content (depends on ‘Variable mode = language’) Data Yes
Var: artistId Variable mode: String Value: _1.id
  Var: sobjects Variable mode: Data Data: payload.findAll {it.name == ‘bananas’} Var: queries Variable mode: Language Lang: Groovy Content: if (payload.id>100) return ‘furniture’