Skip to content

AiTester

AiTester enables AI capabilities during test case execution. Use AiTester to generate data, perform image-based assertions (such as finding discrepancies and analyzing displayed content), and handle other tasks that require AI processing.

Action Summary

Action Description
Assert Tests assertion against the provided text (hard assert).
AssertLastResponse Tests assertion against the last response (hard assert).
DoAnalyzeReport Analyzes TRP report and provides root cause analysis.
DoFullScreenQuery Sends a text query along with a screenshot of a desktop to AI model using specified or default workflow.
DoImageQuery Sends a text query along with an image to AI model using specified or default workflow.
DoMultiImageQuery Sends a text query along with the set of images added via AiTester.StackWebImage / StackImage / StackImageFile.
DoObjectQuery Sends a text query along with a screenshot of an object to AI model using specified or default workflow.
DoTextQuery Sends a text query to AI model using specified or default workflow.
DoWebImageQuery Sends a text query along with a browser screenshot to AI model using specified or default workflow.
DoWebImageVerify Sends a text query along with a browser screenshot to AI model using specified or default workflow.
DoWindowQuery Sends a text query along with a screenshot of a window with the given title to AI model using specified or default workflow.
LogSessions Enables/disables session logging.
SetDefaultWorkflow Sets default workflow.
SoftAssert Tests soft assertion against the provided text.
SoftAssertLastResponse Tests soft assertion against the last response.
StackImage Adds a screenshot to the batch to send along with the AiTester.DoMultiImageQuery.
StackImageFile Adds a screenshot file to the batch to send along with the AiTester.DoMultiImageQuery.
StackWebImage Adds browser screenshot to the batch to send along with the AiTester.DoMultiImageQuery.

Action Detail

Assert

Tests assertion against the provided text (hard assert).

AiTester.Assert(text, assertion)

Parameters:

Name Type Description
text string Input text.
assertion string Assertion to test against the response.

AssertLastResponse

Tests assertion against the last response (hard assert).

AiTester.AssertLastResponse(assertion)

Parameters:

Name Type Description
assertion string Assertion to test against the response.

DoAnalyzeReport

Analyzes TRP report and provides root cause analysis.

Notes: - Requires Rapise 8.4+ - Converts TRP to JSON, may drop most screenshots if JSON is too large, then sends to AI. - Returns AI-produced analysis text (or false on failure).

AiTester.DoAnalyzeReport(title, path)

Parameters:

Name Type Description
title string Report message title.
path string Path to TRP report.

DoFullScreenQuery

Sends a text query along with a screenshot of a desktop to AI model using specified or default workflow.

AiTester.DoFullScreenQuery(query, workflow)

Parameters:

Name Type Description
query string Text query to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoImageQuery

Sends a text query along with an image to AI model using specified or default workflow.

AiTester.DoImageQuery(query, iw, workflow)

Parameters:

Name Type Description
query string Text query to send.
iw ImageWrapper Image to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoMultiImageQuery

Sends a text query along with the set of images added via AiTester.StackWebImage / StackImage / StackImageFile. Clears the stack after the query.

AiTester.DoMultiImageQuery(query, workflow)

Parameters:

Name Type Description
query string Text query to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoObjectQuery

Sends a text query along with a screenshot of an object to AI model using specified or default workflow.

AiTester.DoObjectQuery(objectId, query, workflow)

Parameters:

Name Type Description
objectId objectId ID of an object in the object repository.
query string Text query to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoTextQuery

Sends a text query to AI model using specified or default workflow.

AiTester.DoTextQuery(query, workflow)

Parameters:

Name Type Description
query string Text query to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoWebImageQuery

Sends a text query along with a browser screenshot to AI model using specified or default workflow.

AiTester.DoWebImageQuery(query, workflow)

Parameters:

Name Type Description
query string Text query to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoWebImageVerify

Sends a text query along with a browser screenshot to AI model using specified or default workflow. Verifies the result using an assertion.

AiTester.DoWebImageVerify(query, assertion, workflow)

Parameters:

Name Type Description
query string Text query to send.
assertion string Assertion to test against the response.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

DoWindowQuery

Sends a text query along with a screenshot of a window with the given title to AI model using specified or default workflow.

AiTester.DoWindowQuery(title, query, workflow)

Parameters:

Name Type Description
title string Window title. Supports regular expressions.
query string Text query to send.
workflow string Name or Id of the workflow to use. Default value is AI Chat. You may set the workflow with AiTester.SetDefaultWorkflow.
Optional.

LogSessions

Enables/disables session logging.

AiTester.LogSessions(b)

Parameters:

Name Type Description
b boolean If true - a session will be created for each AI request. Review the sessions in the AI Dashboard.

SetDefaultWorkflow

Sets default workflow.

AiTester.SetDefaultWorkflow(workflow)

Parameters:

Name Type Description
workflow string Name or Id of the workflow to set as default.

SoftAssert

Tests soft assertion against the provided text.

AiTester.SoftAssert(text, assertion)

Parameters:

Name Type Description
text string Input text.
assertion string Assertion to test against the response.

SoftAssertLastResponse

Tests soft assertion against the last response.

AiTester.SoftAssertLastResponse(assertion)

Parameters:

Name Type Description
assertion string Assertion to test against the response.

StackImage

Adds a screenshot to the batch to send along with the AiTester.DoMultiImageQuery.

AiTester.StackImage(iw)

Parameters:

Name Type Description
iw ImageWrapper Image object.

StackImageFile

Adds a screenshot file to the batch to send along with the AiTester.DoMultiImageQuery.

AiTester.StackImageFile(path)

Parameters:

Name Type Description
path string Image object.

StackWebImage

Adds browser screenshot to the batch to send along with the AiTester.DoMultiImageQuery.

AiTester.StackWebImage()