
Presuming you've logged in to the NeoLoad CLI...

neoload-compose or nlc (alias)

2020:

nlc transaction GetAndPost   http --get http://httpbin.org/get?test=123   delay 1s
nlc -c extract --name traceId --jsonpath ".headers['X-Amzn-Trace-Id']" --regexp "=(.*)"
nlc -c http --post http://httpbin.org/post --body '{"trace_id":"${traceId}"}'   delay 1s
nlc current
nlc -c ramp --to 10 --per 1s \
    duration 2m

# gets a trace token from one request and uses it in the header of another
nlc transaction GetAndPost \
    http --get http://httpbin.org/get?test=123 delay 1s \
    extract --name traceId \
            --jsonpath ".headers['X-Amzn-Trace-Id']" \
            --regexp "=(.*)" \
    http --post http://httpbin.org/post --body "{'trace_id':'${traceId}'}" \
    delay 1s

# reads the contents of a file in and uses them as the body content of a PUT
cat ./body_data.json | nlc -c \
    transaction PostBodyFile \
    http --put http://httpbin.org/put --body - \
    delay 1s

# grabs credentials (username/password) from a CSV file to use in an HTTP POST
nlc -c \
    transaction AuthenticateUNP \
    variable --name creds \
      file --columns uname,pwd ./recently_generated_credentials.csv \
    http --post http://httpbin.org/post?action=login \
         --body "{'username':'${creds.uname}','password':'${creds.pwd}'}" \
    delay 1s

# read the contents of a file in as a static API token
cat ./recently_generated_token.txt | nlc -c \
    transaction AuthenticateToken \
    variable --name api_token constant - \
    http --post http://httpbin.org/post?action=login \
    header "api_token=${api_token}" \
    delay 1s

# adds variation & duration policies then prints out the YAML before running it
nlc -c \
    ramp --to 10 --per 1s \
    duration 2m \
    current \
    run --zone any MyTest

# continuation, particularly when reading large contents from STDIN
nlc transaction One http --get http://httpbin.org/get?test=123 delay 1s
cat ~/some.json | nlc --continue transaction Two http --post http://httpbin.org/post --body - delay 250ms

# add a header, and with --all apply to all prior builder requests
nlc -c header --all --name "accept" --value "application/json"
...

# add SLAs; by default, applies to most recent request or container only, unless --all is used
nlc -c sla --all --name geo_3rd_party threshold --error-rate --warn 5 --fail 10 my_sla
# apply a specific sla (defined up front or prior) to a request or container
nlc -c transaction One http --get http://httpbin.org/get?test=123 --sla some_specific_sla delay 1s

# at any time, you can see what the yaml would be sent to NeoLoad Web
nlc current

# run command makes system calls to standard NeoLoad CLI ('neoload ...')
nlc run --save --zone $NLW_ZONE_STATIC
...or...
nlc config zone $NLW_ZONE_STATIC test-setting MyTest
nlc run


TODO:
- transpose/import?
  - postman/SUI os
  - CSV files

- extractors
- file variables
- other variables
- includes (for things like dynatrace settings)
- curl and wget compat for http requests?
- what about existing nlps?
