8.2 - Test Designer API Reference

Test Designer API Reference

API Test Designer Building Blocks

Appvance IQ Test Designer provides a collection of building blocks that can be combined to create automated tests and performance scenarios. Each building block provides a specific capability, such as sending HTTP requests, validating responses, controlling test flow, working with test data, executing JavaScript, or interacting with external services.

Building blocks are added to a test by selecting them from the Building Blocks panel and configuring their properties according to the requirements of the test.

This section provides an overview of the available building blocks. Each building block has its own page with detailed information about its purpose, configuration options, and usage examples.

Request and Service Blocks

These building blocks allow tests to interact with web services and APIs.

REST requests support the standard HTTP methods:

Test Designer also provides import options for creating requests from existing definitions:

Flow Control Blocks

Flow control blocks determine how and when test steps are executed.

Data and Configuration Blocks

These blocks provide mechanisms for supplying, managing, and reusing test data.

Database and Integration Blocks

These blocks allow tests to interact with external systems and data sources.

Scripting and Specialized Blocks

These blocks provide additional capabilities for custom logic and specialized test interactions.

Building Block Workflow

Building blocks can be combined to create complete test flows. For example, a test might:

  1. Read test data from a Data File.
  2. Send a request using a REST Request.
  3. Use Verify to validate the response.
  4. Use a Condition to determine the next step.
  5. Execute additional requests or logic inside a For Loop.
  6. Store values in the Locker for use by subsequent steps.

The appropriate combination of building blocks depends on the type of application being tested and the behavior that the test needs to reproduce or validate.

The following pages describe each building block in detail, including its configuration, supported options, and examples of how it can be used in a test.


Last updated: August 12, 2026

If you have feedback about this topic, please contact documentation@appvance.ai.

Browser Dialogs and Message Boxes

JavaScript applications raise modal dialogs and browser-native message boxes during playback. There are two sides to handle, and they are not the same thing:

These calls block browser execution until the dialog is dismissed. Never leave them in a production or CI script: the run will hang waiting for a person.

API reference

APISignatureWhat it does
alertalert(String: message)Triggers a native alert. Handy as a debugging or logging call — use it to inspect what a variable holds during runtime.
confirmconfirm(String: message)Triggers a native confirm. Call it from CustomJS in action, together with the confirm API.
promptprompt(String: prompt, String: defaultValue)Triggers a native prompt. Call it from CustomJS in action.
printprint()Triggers the native print dialog. Call it from CustomJS in action.

Example — alert as a runtime check

navigateTo("http://www.apple.com");
click(link("ac-gn-link ac-gn-link-iphone"));
click(heading4("typography-headline-reduced"));

var var1 = isVisible(heading4("typography-headline-reduced"));
alert(var1);

if (var1 == true)
{
    click(link("ac-gn-link ac-gn-link-watch"));
}

An alert left in a script stops playback until someone closes it. Remove it before the script is promoted.

Handling a message box raised by the application

TypeBehaviour
AlertInformational dialog, usually dismissed with OK.
ConfirmDialog that expects an accept or dismiss decision — the branch can change the page state.
PromptDialog that may require controlled text before it can be accepted.

Validation workflow

Confirm the dialog is generated by the application, not by the browser as a permission or security prompt. Permission prompts are browser-profile settings, not script steps, and print / navigation dialogs are outside the DOM.

Legacy content

Older Test Designer examples for message boxes were written against previous browser behaviour. Validate any legacy snippet in the current Scenario Editor runtime before reusing it, because native dialog handling depends on the browser and node version in use.

Related: Conditional Functions, Assert Functions.

Fuzzy Logic and Regex Locators

On certain dynamic sites, using strict locators is most of the time challenging and also changing. A strict locator is a locator of an element that should match complete an attribute or a text, meaning it should always match ID or class, etc, or with the complete text of the element.

Test Designer offers the use of Fuzzy and Regex Locators which will help in handling any dynamic contents of any web application.

Example:

Below is one example of a dynamic locator where the heading would keep changing.

heading1("Build office's profile")

Edit the recorded step to replace the accessor with the right expected text value, or a portion of it using the square brackets or in Regex

heading1(["This is a significative portion of the expected text"]) //This is Fuzzy Logic

or

heading1(/.*This is a significative portion of the expected text./); // IMPORTANT: Regular Expression SHOULD NOT be enclosed in quotes, otherwise will be treated as a string }}


Choosing a locator strategy

Use a strict locator when the target attribute or text is stable and unique. Use a fuzzy or regular-expression locator when the application generates changing values, but keep the pattern as narrow as possible so it does not match multiple elements.

Validation

After editing a recorded accessor, replay the step against representative page states and confirm that exactly the intended element is selected. If the pattern matches more than one element, refine the stable portion of the attribute or text.

Last updated: October 15, 2026

If you have any feedback on this topic, please contact us at documentation@appvance.ai

Keyboard Press Events

Keyboard Press Events

All of the mentioned KeyPress events are supported. All of them are associated with a search box, where you want to enter the keyboard after setting the text in a text field, pressing tab after setting the text in a text field to go to the next element on the page when there is no option on the page to click after setting the value.

image.png

The home button can be used to point the mouse to the first character and delete deletes the first character when used in combination of Home, Shift+Home+Delete combination will delete all the contents that are set in the text field which is used for some validations.

image.png

Esc

There could be instances where you would want to press the Keyboard Esc for closing the pop up for example.

Test Designer supports pressing Esc from the keyboard.

image.png

Javascript example:

setSearchRetries(3);
prepareDomain("http://MSI:8080");
navigateTo("http://MSI:8080/UI/test/AIQ5811.html");
click(submit("btn btn-success"));
setValue(div("alertModal"),"{{ESC}}");

Test Designer supports keyboard events of all the above keyboards, below is the example of the usage.

image.png

Javascript example:

navigateTo("https://office.live.com/start/excel.aspx");
setValue(emailbox(0),"xxxx@appvance.com");
click(submit(0));
setDescription("provide password in double quotes");
setValue(password(0),);
click(submit(0));
click(button("No"));
click(div("New blank workbook[1]"));
wait(5000);
setDescription("Clicking some cell");
clickXY(canvas("ewr-sheettable"),"201,29");
assertExists(canvas("ewr-sheettable"));
keyboardCommand(setValue(div("gridKeyboardContentEditable"),"new value");
keyboardCommand(div("gridKeyboardContentEditable"),"DOWN");
keyboardCommand(div("gridKeyboardContentEditable"),"UP");
keyboardCommand(div("gridKeyboardContentEditable"),"CTRL B");
copy(div("ewa-fb-text-box"));
keyboardCommand(div("gridKeyboardContentEditable"),"DOWN");
paste(div("gridKeyboardContentEditable"));
keyboardCommand(div("gridKeyboardContentEditable"),"PAGE_DOWN");
keyboardCommand(div("gridKeyboardContentEditable"),"RIGHT");
keyboardCommand(div("gridKeyboardContentEditable"),"PAGE_UP");
keyboardCommand(div("gridKeyboardContentEditable"),"CTRL S");
keyboardCommand(div("gridKeyboardContentEditable"),"CTRL V");
log("OK");

Using Default JavaScript Methods

Using default JavaScript methods like new Date().getYear(), Math.random()

Sometimes it is required to use some default JavaScript methods like the date functions, or even when we need to generate some random number that can be used to set value and also to generate a random number followed by a name, etc, In these and many cases JavaScript methods would come handy.

The example below shows you a simple usage of date methods and also a random number generation method that is stored in a variable and can be used in Set Values or any Assertions.

APIRef_UsingDefaultJava01.png

In this example, you would notice the usage of date methods and they are being stored in a variable and also the use of random method along with the name Appvance which generates texts like 'Appvance852' with a random number ranging from 1 to 1000 which could be used as a value in an API says 'Set Value'

Example:

eval("'Test'+ Math.floor(Math.random()*1000)");

eval("'Test'+ Math.floor(Math.random()*1000)") + '@appvance.com';


Similarly, many other JavaScript methods could be used this way in Test Designer IDE.

APIRef_UsingDefaultJava02.png


APIRef_UsingDefaultJava03.png

JavaScript:

navigateTo("SahiTest ");
click(link("demo"));
click(link("Form Test"));
var var1=eval("new Date().toISOString()");
log(var1);
var var2=eval("new Date().getYear()");
log(var2);
var var3=eval("new Date().getDay()");
log(var3);
var var4=eval("new Date().getMonth()");
log(var4);
setValue(textbox("t1"),var1);
setValue(byXPath('//form/table/tbody/tr[3]/td[2]/input'),"2435");
setValue(textbox("name"),"name");


Library APIs

<p>&lt;p&gt;&lt;/p&gt;</p>

Library APIs

Add Network Library


This API could be used to add your created network library using network library workbench, network library will have a .netx extension and any step using the network library will be accessing this particular file.

After selecting this action, you can double click the Accessor which shows options to browse the file and also to make the path absolute or relative.

API_General_AddNetworkLibrary.png

Library APIs

Add SmartTag Library

This API is similar to that of Network Library which can be used to browse the SmartTag library created for a target application using SmartTag workbench. This has a .stags extension, and any step that uses the SmartTag library will access this particular file for details.

After selecting this action, you can double click the Accessor which shows options to browse the file and also to make the path absolute or relative.

API_General_AddSmartTagLibrary.png