last, error, api, request, response, send, soap, rest, get, post, put, delete

Method GetLastError

API

Returns Last Error Message

Watch this video to learn how to use this method

Have a problem with playback?
GetLastError method returns latest error message from API resposne (if there is one) The output is a string with error code of API error. If there is no error appeared the output is empty Let's change our API server name to the wrong one. Do Execute of the method first and output GetLastError to the message box. We can see the error is 404 - server not found, es expected.

Usage

Function GetLastError(
  Boolean Report [Optional]
)

Method

ZAP API Method step

GetLastError

True

error

Report

Output Parameter

Parameters

Report (optional)

Type: Boolean

Default Value: False

Generate report for this step

Returns

Error Message

Example

VBScript

Server("API Server").Method("Method").Execute
' Check last error
msgbox Server("API Server").Method("Method").GetLastError(True)

JavaScript

Server("API Server").Method("Method").Execute();
// Check last error
alert(Server("API Server").Method("Method").GetLastError(true));

Method

ZAP API Method step

Execute

Script-Less next step

Comment

Check last error

Script-Less next step

Method

ZAP API Method step

GetLastError

True

error

Contact Us

1425 Market Blvd Suite 530-230

Roswell, GA 30076, USA

(800) 795-3552