skipIf Usage
skipIf conditionally skips work when its expression evaluates to true.
LPS supports skipIf in two places:
- at iteration level
- at
httpRequestlevel
Iteration-Level skipIf
Use iteration-level skipIf when the whole iteration should be skipped.
name: IterationFeaturesPlan
rounds:
- name: FeatureRound
numberOfClients: 50
arrivalDelay: 100
runInParallel: false
iterations:
- name: LoginIteration
httpRequest:
url: https://httpbin.org/post
method: POST
headers:
Content-Type: application/json
payload:
raw: |
{ "username": "user", "password": "pass" }
- name: Home
httpRequest:
url: https://httpbin.org/
httpMethod: Get
skipIf: ${LoginResponse.StatusCode} = 401
Request-Level skipIf
Use httpRequest.skipIf when the iteration should still exist in the flow but the request itself should not be sent.
name: TestPlan
rounds:
- name: FeatureRound
numberOfClients: 10
arrivalDelay: 1000
runInParallel: false
iterations:
- name: users
httpRequest:
capture:
to: users
as: Json
makeGlobal: true
url: https://jsonplaceholder.typicode.com/users
method: GET
- name: httpbinOrg
httpRequest:
skipIf: ${users.Body[$length($users.Body)-1].id} = 10
httpMethod: Get
url: https://httpbin.org/
Supported Expression Inputs
skipIf expressions can use:
- normal variables
- captured response fields such as
StatusCode,Headers, andBody - declarative methods such as
$length(...)and$randomItem(...)using positional orsource=input - arithmetic expressions inside JSON, XML, and CSV index positions
Tips
- Wrap complex placeholders with
${...}when they contain stoppers or special characters. - XML body paths use XPath semantics, so repeated elements are one-based.
- Use request-level
skipIffor targeted suppression and iteration-levelskipIffor broader flow control.