config: target: "https://ven03142.service-now.com" inputs: - name: 'Client_ID' default: '15a2cf0f26ebb300f21af712c78b4e59' - name: 'Client_Secret' default: '?es`BNI@wh' - name: 'Username' default: 'Apica.api' - name: 'Password' default: 'Apica-api' - name: 'Table' default: 'incident' scenarios: - name: "SNOauthExample1" flow: - page: name: "Authenticate" thinktime: 0 - post: url: "/oauth_token.do" headers: Content-Type: "application/x-www-form-urlencoded" form: - key: "grant_type" value: "password" - key: "client_id" value: "{{Client_ID}}" - key: "client_secret" value: "{{Client_Secret}}" - key: "username" value: "{{Username}}" - key: "password" value: "{{Password}}" capture: - json: target: "$.access_token" as: "access_token" - json: target: "$.refresh_token" as: "refresh_token" - json: target: "$.token_type" as: "token_type" - json: target: "$.expires_in" as: "expires_in" # - - page: name: "GetRandomTask" thinktime: 1 - get: url: "/api/now/table/{{Table}}?sysparm_offset=0&sysparm_limit=10" headers: Authorization: "{{token_type}} {{access_token}}" capture: - json: occurrence: 1 random: true target: "$.result[*].sys_id" as: "sys_id" - get: url: "/api/now/table/{{Table}}/{{sys_id}}" headers: Authorization: "{{token_type}} {{access_token}}" capture: - json: target: "$.result.number" as: "task_number"