[LLM] Assert File
This keyword is available from Katalon Studio version 11.5.0+.
Enable an AI service for your account and select a provider in Katalon AI Assistant Preferences.
Description​
Send one or more image or text-like files to the configured AI service and assert that their contents meet a nonblank plain-language expectation. This is an AI judgment rather than a deterministic file comparison.
Keyword name: assertFile
File paths can be absolute or relative to the project folder. Supported image types are png, jpg, jpeg, webp, gif, heic, and heif. Supported file types are txt, csv, json, log, and pdf. Extension matching is case-insensitive. Each file must not exceed 10 MB.
The step fails when the AI returns a valid FAIL verdict. A missing or blank path, unsupported or oversized file, unavailable AI service, or malformed verdict causes an execution error. Both failures and errors follow the configured failure handling.
Parameters​
The Manual view uses assertFile(String[] filePaths, String expectation). The optional flowControl parameter is available in script overloads.
| Parameter | Parameter Type | Required | Description |
|---|---|---|---|
filePaths | String[] | Yes | Specifies one or more absolute paths or paths relative to the project folder of files to evaluate. Script overloads also accept one String or a List<String>. |
expectation | String | Yes | Specifies the nonblank expectation that the files must meet, in plain language. |
flowControl | FailureHandling | No | In script overloads, specifies the failure handling behavior. When omitted, the keyword uses the configured default failure handling. |
Examples​
String[] reportFiles = ['Data Files/summary.pdf', 'Data Files/results.csv']
LLM.assertFile(reportFiles, 'The summary is consistent with the test results.')
// Script-only single-path overload with explicit failure handling
LLM.assertFile('Data Files/screenshot.png',
'The image shows a successful checkout confirmation.',
FailureHandling.CONTINUE_ON_FAILURE)