9.13 - Test Designer 2.0 / Test Designer 3.0

Test Designer 2.0 / Test Designer 3.0 — Knowledge Base articles.

Legacy Test Designer 2.0 and 3.0 Reference

Contents

This section contains a collection of articles from the Appvance Knowledge Base.


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

Last updated: October 16, 2026

Automating Multi-Factor Authentication in Scenario Editor

Some webapps you are testing may request an authenticator app short code as part of the login process. Microsoft Authenticator and Google Authenticator are the most commonly used authenticator applications but there are others.

You can configure a third-party service to provide a code when creating a AIQ test designer script. In order to create a test designer script that automate test use cases over this application, a third party service can be configured configured as the code provider.

The third-party services currently supported by AIQ is passwordstate. For more information see passwordstate.

Configure the Authentication Code in the Application

These steps involves creating a new user in the application you are testing and setting the MFA authentication with the passwordstate. The following example shows Microsoft Authenticator and passwordstate.

In a real situation some of these screens would normally show user details such as email addresses or phone numbers. The following example shows generic screens.

  1. Anytime you try to login you are presented with MFA option to verify your identity.

  2. Select “I can’t use my Microsoft Authenticator app right now”.

  3. On the Add a method screen, select an Authenticator app as the new method.

  4. Select “I want to use a different authenticator app”.

  5. The Authenticator app presents you with a QR code. Scan the code the app for passwordstate .

  6. Enter the code that the app gives you in the One-Time Password Authenticator details.

Logging in with the One-Time Password Code

The OTP code generated by passwordstate can be fetched using a REST API call triggered from your test script. The response will contain the code which can be used to complete the authentication process in the test designer script.

  1. Login to your security portal and remove your current device.

  2. Login using the OTP.

  3. Successful login.

  4. You may need to verify the account, but only the at the first login. Subsequent logins should not require account confirmation.

Getting a Password

To get a password, you must make an API call that can be executed from a JS script.

# Configuration

API_URL="https://client-passwords.appvance.net/api/onetimepassword/<item>"API_KEY="API_KEY"# Make API request using curl

curl -s -H "APIKey: $API_KEY" "$API_URL"

Appvance will create a passwordstate for clients which will have a different URL. Contact Appvance Support to have Appvance whitelist your IP adress and setup an OTP in passwordstate.


Last updated: October 01, 2024

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

Browser Versions for Scenario Editor Testing

Browser version alignment is important for reliable Scenario Editor playback. Validate the browser, browser driver, Test Node, operating system, and AIQ version together before treating a failure as a scenario defect.

When to check browser versions

  1. Record the browser name, browser version, Test Node, operating system, and AIQ build used for the run.
  2. Confirm the browser is supported by the current AIQ release and the selected execution mode.
  3. Check enterprise-managed browser policies before changing browser settings.
  4. Reproduce with a controlled browser version when troubleshooting regressions.
  5. Update documentation and execution notes when a browser version becomes a known dependency.

Terminology note: Use Scenario Editor for current AIQ authoring and playback references. Older Test Designer references should be treated as legacy unless the page is specifically describing a legacy asset.

Last updated: October 5, 2026

Automate Scrolling in Scenario Editor

When element is not visible in the table view, we need to scroll down till element gets visible in the table view.

Ex:- Patient Number "L100" is not visible in the below table view, So we need to click the Scroll bar till element gets visible in the table view.


To achieve above scenario sahi API provides the "scrollTop" function.

Below is the sample sahi code to automate the above scenario.

_div("pt1:r2:0:pc1:pt_t1::scroller") is the Scrollbar element in the respective Application (This Scrollbar element may vary from application to application).

"Scrollbar-element.scrollTop" is the syntax to simulate the mouse hover and click scrollbar.

Used while loop in the code to iterate click scrollbar multiple times till element gets visible in the table view.

SCROLLING FUNCTION USAGE IN TEST DESIGNER:

There are various approaches one can use to do scroll – be it vertical/horizontal.Those are below:

Use CustomJS action from Action dropdown while using in scripts.Try these in browser's console before using in scripts.

JAVASCRIPT APPROACHES:

1.document.getElementById(<id>).scrollTo(1000,0) -----------→ > This is to horizontal scrolling – y co-ordinates would be zero. you can try with x coordinate value of any number.

document.getElementsById(<id>).scrollTo(0,1000) ----------→ This is for Vertical scrolling - X co-ordinates would be zero. you can try with y coordinate value of any number.

Following will retrieve a list of elements matching this class .So accordingly we have to select the correct element to do the scroll.

2.document.getElementsByClassName(<classvalue>)

document.getElementsByClassName(<classvalue>)[1] – 2nd element from the list..

document.getElementsByClassName(<classvalue>)[1].scrollTo(1000,0)

3.document.getElementsByName(<name>) – name of element — document.getElementsByName(<name>)[1].scrollTo(1000,0)

4.document.getElementsByTagName(<tagname>) – tagname of element — document.getElementsByTagName(<tagname>)[1].scrollTo(1000,0)

5.document.getElementsByTagNameNS(<namespace>,<tagname>) – name of element — document.getElementsByTagNameNS(<namespace>,<tagname>)[1].scrollTo(1000,0)

Usage in Script – _eval("document.getElementById(<id>).scrollTo(1000,0)") — wrap the above in _eval("") to be used in script in ds or js scripts.

JQUERY APPROACHES:

Normal jquery selectors can be used – as ds$('#id') , ds$('.classvalue') ,etc..

ds$('#id').scrollTop(500) — > This will scroll vertically

ds$('#id').scrollLeft(500) — > This will scroll horizontally.

Usage in Script – _eval(" ds$('#id').scrollTop(500)") - wrap the above in _eval("") to be used in script in ds or js scripts.

XPATH APPROACHES:

If there are no proper identifiers for the element such as no class/id/name/title or any other attribute , then one can go by XPATH – relative or absolute XPATH. Inspect the element .Then right click element in inspect panel – click copy – then click xpath/selector options etc to be used for scrolling.

usage of XPATH to use in scrollTo:

Eval in Browser as action and value to be used is - _ds.byXPath("//*[@id='dtHorizontalExample_wrapper']/div[2]/div/div/div[2]").scrollTo(200,0) — This is for horizontal scrolling. Same can be used for vertical scroll except the coordinates data 0,200. as in _ds.byXPath("//*[@id='dtHorizontalExample_wrapper']/div[2]/div/div/div[2]").scrollTo(0,200)



Last updated: June 26, 2023

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

Find the Position of an HTML Element in Scenario Editor

Use element position checks only when a Scenario Editor test truly needs layout validation or coordinate-aware behavior. Prefer stable accessors, labels, and assertions before relying on screen coordinates, because positions can change by browser, device, zoom, responsive layout, or application state.

When position matters

Validation checklist

  1. Confirm the element is present, visible, and not covered by another element.
  2. Record browser, viewport, zoom, device scale, and Test Node details.
  3. Use waits so layout has stabilized before reading position.
  4. Avoid hard-coded coordinates unless there is no stable semantic locator.

Last updated: October 6, 2026

Add Snapshot Evidence in Scenario Editor

Add Snapshot Evidence in Scenario Editor

This page replaces old Designer 2.0 wording with current Scenario Editor guidance. Add snapshot evidence when a screenshot or captured state will help diagnose a failure or prove an important business checkpoint.

When snapshots help

Good practices

  1. Name the step clearly so the snapshot is easy to find in output.
  2. Capture only useful checkpoints; too many snapshots make analysis noisy.
  3. Keep sensitive customer data out of screenshots when possible.
  4. Attach execution output to the related defect or maintenance note.

Last updated: September 9, 2026

How to access and extract the content of the table

p>

How can I wait for an object to disappear?

Problem

I need to wait until an object disappears.

Context

My application has reports it generates, and it can take time. When a report is generating, an animated Please Wait image and text appears. Once the report is generated, the page loads and the Please Wait image and text goes away.

Solution

Option A

Wait until the object is no longer visible, but only wait for a maximum amount of time. Notice the not (!) negating the isVisible statement.

Action

Accessor

Wait

60000,!(isVisible(paragraph("Please Wait")))

Option B

If you want to wait, as well as check something else while waiting, you could use .wasNotFound() in a While. Note: The Set Search Retries lowered to and then restored after the While completes.

Action

Accessor

Set Search Retries

2

While

!(paragraph("Please Wait").wasNotFound())

Wait

1000

End While

Set Search Retries

12


Last updated: June 02, 2023

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

Return the Current Date in a Specified Format

You can use the following function to return the current date in a specific format.

The example below returns the date in the following format:

DD-MMM-YYYY

For example:

24-Aug-2026

Example

function datefunc() {

    var monthNames = new Array(
        "Jan", "Feb", "Mar",
        "Apr", "May", "Jun",
        "Jul", "Aug", "Sep",
        "Oct", "Nov", "Dec"
    );

    var date = new Date();

    var day = date.getDate();
    if (day < 10) {
        day = "0" + day;
    }

    var month = date.getMonth();
    var year = date.getFullYear();

    var formattedDate = day + "-" + monthNames[month] + "-" + year;

    return formattedDate;
}

var currentDate = datefunc();
log(currentDate);

How It Works

The function uses the JavaScript Date object to retrieve the current date.

For example, if the current date is August 24, 2026, the function returns:

24-Aug-2026

Changing the Date Format

You can modify the formattedDate expression to return a different format.

For example, to return YYYY-MM-DD:

var formattedDate = year + "-" + (month + 1) + "-" + day;

To return DD/MM/YYYY:

var formattedDate = day + "/" + (month + 1) + "/" + year;

Note: getMonth() returns a zero-based month value. Therefore, add 1 when using the numeric month directly in the formatted date.


Last updated: August 24, 2026

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

EnterKey Event in Sahi.

Below is the sample code snippet to work with EnterKey.

var $storedVars = new Array();
_sahi.robot = new java.awt.Robot();
Sahi.prototype._typeNativeKeyCode = function(keyCode){
this.robot.keyPress(keyCode);
this.robot.keyRelease(keyCode);
};
_navigateTo("http://sahitest.com/demo/training/login.htm");
_setValue(_textbox("user"),"test");
_setValue(_password("password"),"secret");
_sahi._typeNativeKeyCode(java.awt.event.KeyEvent.VK_ENTER);
_wait(10000);

Because key events are sent at the operating-system level, keep the application under test active while replaying the scenario.


Last updated: October 15, 2026

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

Designer: file:// Protocol Support

Issue

Appvance Designer does not support automating pages opened directly using the file:// protocol.

Solution

To automate a local HTML page with Designer, serve the page through a web server instead of opening it directly with the file:// protocol.

  1. Start a web server that serves the directory containing your HTML pages.
  2. Open the page using its HTTP or HTTPS URL, for example:
    http://localhost:8080/index.html
  3. Open the page in Designer using the web server URL.
  4. Create or run your automation against the page served through HTTP/HTTPS.

Note: Opening the page directly from the local file system using a URL such as file:///C:/path/to/page.html is not supported for Designer automation.


Last updated: August 19, 2026

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

Date Functions and Formatting

First example is this:

Create a logic so that the script should always choose a date that is 3 days ahead of the todays date and make sure that 3 days ahead date is not landing on any weekends i.e., Sat/Sun.

function getThreeDaysAhead()
{
var myDate = new Date();
myDate.setDate(myDate.getDate() + 3); //Three days ahead of today's date
var day = myDate.getDay(); //getDay() returns 0-6, 0 for sunday.. , 6 for saturday
log(day);
if (day == 6) {
myDate.setDate(myDate.getDate() + 2); //If saturday , do plus 2 days
} else if (day == 0) {
myDate.setDate(myDate.getDate() + 1); // If Sunday , do plus 1 day
}

return formatDate(myDate);

}

Date Formatting functions:

function formatDate(date) {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
year = d.getFullYear();

if (month.length < 2)
month = '0' + month;
if (day.length < 2)
day = '0' + day;

return [month, day, year].join('/');

}

Below are some examples using toLocaleDateString();

var date2 = new Date(date1).toLocaleDateString("en-US");
log(date2); //will return in US time format
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var date3 = new Date(date1).toLocaleDateString("en-US", options);
log(date3); ////will return in US time format with options as specified above
var date4 = new Date(date1).toLocaleDateString("en-GB", options);
log(date4); //will return in UK time format

date.js

some examples from browser console using toLocaleDateString functions:

These functions can be directly used in ds file – customJS as action and function name can be called simply like the normal javascript calling.


Last updated: July 03, 2023

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

Shadow DOM Settings for Scenario Editor Tests

A Shadow DOM setting (forcedShadowDom) has been added to the global.json file. The default value is true. The Shadow DOM setting in the script options in the Test Designer IDE (Set ShadowDOM) will be ignored if the forcedShadowDom is set to true. Even if that option is set to false in the Test Designer IDE, scripts will be run with the option set to true.

This was added in the 4.10.6 and 5.0.0 releases of AIQ.

Generally speaking, there is no longer any reason for having the Shadow DOM option turned off. Setting it off will not help or prevent any problems or failures. Having it set to off can actually cause failures in instances where a script tries to perform a click action on a element that is under Shadow DOM.

In previous releases, there may have been concerns of some potential performance issues when the setting was on versus the setting being off. Those issues have been addressed.

Examples

Any Shadow DOM setting of “true” will result in the test case finding the Shadow DOM elements successfully. However, the setting in the global.json file will always override the option set locally in the test script.

Following are some examples of the script execution results from the various combinations of settings between the forcedShadowDom setting in global.json and the Set ShadowDOM action specified in test scripts.

The example test scripts were recorded using the public Salesforce site which has Shadow DOM elements as shown in the examples.

Example 1

Settings:

Expected behavior:

Example 2

Settings:

Expected behavior:

Example 3

Settings:

Expected behavior:

Example 4

Settings:

Expected behavior:

Example 5

Settings:

Expected behavior:

Example 6

Settings:

Expected behavior:


Last updated: March 19, 2024

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

Grant Microphone Permissions for Scenario Editor Tests

Use this article when a Scenario Editor test must interact with a browser workflow that requests microphone access.

Validation workflow

  1. Confirm the test environment is approved to use microphone access and does not capture sensitive audio.
  2. Preconfigure the browser profile or test policy so the permission behavior is deterministic.
  3. Run the scenario and verify the permission state, browser prompt behavior, and resulting evidence.

Last updated: October 19, 2026

Capture the Current Application URL in Scenario Editor

Suppose you want to extract the URL of the application. Below is the method to extract it.

_eval("window.location.href")

eMFjBQ48JqgZklup-0bd77185970e.png

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

Last updated: October 16, 2026

How to get all values of dropdown

p>

How to get hidden elements from DOM?

Steps:

  1. Open the application in the chrome browser
  2. Inspect the element
  3. Go to the console tab
  4. Paste this code : javascript:(function(){var newScript = document.createElement('script'); newScript.type = 'text/javascript; newScript.src = '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'; document.getElementsByTagName("head")[0].appendChild(newScript);})();
    setTimeout(function(){
    console.log($('#ELEMENT_Attribute').html());},18000);
  5. Mouse over on the element and wait

Last updated: October 15, 2026

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

How to Generate a Random Number Within a Given Range

You can use the following JavaScript expression to generate a random integer within a specified range, including both the minimum and maximum values:

var $randomnumber = Math.floor(Math.random() * ($maximum - $minimum + 1)) + $minimum;

For example, the following code generates a random integer between 3 and 7:

var $randomnumber = Math.floor(Math.random() * (7 - 3 + 1)) + 3;

The generated value can be 3, 4, 5, 6, or 7.

The random value can then be used in a Test Designer action. For example:

_highlight(_link($randomnumber, _near(_span("Smart Account"))))

This approach is useful when test scripts need to select or interact with different values dynamically during execution.


Last updated: August 21, 2026

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

Format Dates for Scenario Editor Tests

Ex: October 20, 2020

=today().format('MMMM d,Y')

Add Functions and methods in JS DPL:

LzZFbbstlW4ubXnr-ac7ea6aabda9.png

Evaluate DPL:

48Yz8F5C35ATwU75-1eedcd27466f.png

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

Last updated: October 16, 2026

How to Data-Drive Xpaths

In some scenarios, an accessor’s XPath must be generated dynamically from test data. Scenario Editor supports data-driven XPath expressions by allowing variables within the XPath expression.

byXPath("//*[@id='" + $Test + "']")

The $Test variable is replaced with the corresponding test-data value when the step executes.


Last updated: October 15, 2026

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

Find Rows by Visual State in Scenario Editor

If the user wants to click a particular link for with Particular Style

Ex: if the user wants to click the link which has Style = background-color:rgb(1,0,0)

The user can use this in the accessor column

cell("style==background-color:rgb(1,0,0)")

fTOVMafhVkNRx36W-fdfbf19ed450.png

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

Last updated: October 16, 2026

Extract Numbers from a String in Scenario Editor

string.replace(/[^0-9.]/g, "") / string.replace(/[^a-zA-Z0-9.]/g, '')

hVfsQ4KAd20u3duv-d4803c61e73f.png

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

Last updated: October 16, 2026

Check Whether a Scrollbar Has Reached the Bottom

When working with applications that contain scrollable grids or containers, you may need to scroll through the content until a specific cell becomes visible.

The following function checks whether the specified cell is visible. If the cell is not visible, it scrolls the target vertical scrollbar and continues checking until the cell is reached.

Note: The scrollbar selector used in this example is specific to the application's DOM structure. The index ([2]) may need to be adjusted depending on which scrollbar is being targeted.

function IsScrollbarAtBottom(VARIABLE) {

    var totalHeight = 1;
    var clientHeight = 0;

    while (totalHeight > clientHeight) {

        var scrollHeight = _eval(
            "document.getElementsByClassName('k-scrollbar k-scrollbar-vertical')[2].scrollHeight"
        );
        var intScrollHeight = parseInt(scrollHeight);

        var scrollTop = _eval(
            "document.getElementsByClassName('k-scrollbar k-scrollbar-vertical')[2].scrollTop"
        );
        var intScrollTop = parseInt(scrollTop);

        var offsetHeight = _eval(
            "document.getElementsByClassName('k-scrollbar k-scrollbar-vertical')[2].clientHeight"
        );
        clientHeight = parseInt(offsetHeight);

        totalHeight = intScrollHeight - intScrollTop;

        log("Scroll height: " + intScrollHeight);
        log("Scroll position: " + intScrollTop);
        log("Client height: " + clientHeight);
        log("Remaining height: " + totalHeight);

        if (isVisible(cell(VARIABLE))) {
            totalHeight = clientHeight;
        } else {
            _eval(
                "document.getElementsByClassName('k-scrollbar k-scrollbar-vertical')[2].scroll(0,40000)"
            );
        }
    }
}

IsScrollbarAtBottom(VARIABLE);

How It Works

The function performs the following operations:

  1. Retrieves the total height of the target scrollbar using scrollHeight.
  2. Retrieves the current vertical scroll position using scrollTop.
  3. Retrieves the visible height of the scrollbar using clientHeight.
  4. Calculates the remaining scrollable height.
  5. Checks whether the specified cell is visible using isVisible(cell(VARIABLE)).
  6. If the cell is visible, the function stops.
  7. If the cell is not visible, the scrollbar is moved down and the check is repeated.

The following calculation determines how much content remains below the current scroll position:

totalHeight = scrollHeight - scrollTop;

Identifying the Target Scrollbar

The example uses the following DOM selector:

document.getElementsByClassName(
    'k-scrollbar k-scrollbar-vertical'
)[2]

The [2] selects the third matching scrollbar element on the page. This value is application-specific and may need to be changed if the page contains a different number or order of vertical scrollbars.

Example

To scroll until a specific cell becomes visible:

IsScrollbarAtBottom(VARIABLE);

Replace VARIABLE with the value used to identify the target cell.

Important: Despite the function name, the primary purpose of this implementation is to scroll through a container until the specified cell becomes visible. It should not be considered a generic scrollbar-position API.



Last updated: October 15, 2026

Generate a Three-Digit Random Number in Scenario Editor

Generate a Three-Digit Random Number in Scenario Editor

Use generated numeric data when a Scenario Editor test needs a simple unique or variable value. Keep the generation rule easy to understand and validate that the application accepts the expected numeric range.

Validation workflow

  1. Generate the number before the input step.
  2. Enter it into the target field.
  3. Validate that the application saved or displayed the same value.
  4. Capture the value in output when diagnosing failures.

Last updated: September 9, 2026

Create Unique Strings in Scenario Editor Scripts

Use this article when a Scenario Editor script needs unique values for usernames, emails, order IDs, or other test data.

Validation workflow

  1. Choose the uniqueness strategy based on the system under test and cleanup requirements.
  2. Store the generated value if later steps need to reuse it for validation.
  3. Run the scenario twice and confirm each run creates a distinct value without breaking assertions.

Last updated: September 28, 2026

Call JavaScript Functions from Scenario Editor

Use this article when a Scenario Editor test needs to call a custom JavaScript function from JS Edit & Play.

Validation workflow

  1. Add the JavaScript file with Include before calling the function.
  2. Call the function with customJS and pass parameters from DPL, constants, or captured variables.
  3. Replay the step in JS Edit & Play and then run the scenario to confirm the function executes in context.

Last updated: September 25, 2026

Data-Drive Wait Values in Scenario Editor

Data-Drive Wait Values in Scenario Editor

Use data-driven wait values only when different test data genuinely requires different timing. Prefer conditional waits based on application state whenever possible.

When data-driven waits make sense

Good practices

  1. Store timing values in an approved DPL or test data source.
  2. Use clear field names such as waitTimeoutSeconds or pollingIntervalSeconds.
  3. Set maximum limits so bad data does not create excessive waits.
  4. Review repeated wait failures before increasing data-driven timing values.

Last updated: September 9, 2026

Validate Scrolling Reaches the Bottom of a Page

Validate Scrolling Reaches the Bottom of a Page

Use this pattern when a Scenario Editor test must confirm that the browser reached the bottom of a page, list, or scrollable container. This is common for lazy-loaded content, terms pages, infinite scroll, or long result lists.

Validation workflow

  1. Scroll toward the target area.
  2. Wait for the expected bottom marker, footer, or final item.
  3. Assert that the expected element or content is visible.
  4. Capture output if the page continues loading or the target never appears.

Last updated: September 9, 2026

Generate a Three-Digit Random Number in Scenario Editor

What do we do when we encounter a special character and we have to assert it in a designer script ?


Lets take the below Example:

User navigates to the Apple website and tries to do a assert on iphone page and finds that the iphone 7 has special character " just before 7. So the user now has to assert iPhone"7 which contains a special character just before 7.

We can "\" to escape the special character and run the script successfully.


VYvRyqFjstu0oJCA-b5d9416e81f7.png

For characters that are usually treated specially, '\' indicates that the next character is not special and should be interpreted literally.


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

Last updated: October 16, 2026

Last updated: October 16, 2026

Close Browser Windows in Scenario Editor

Q: changing window - I wanted to close the new window once its existence had been confirmed but it wouldn’t let me, can’t see the close window accessor and if I try to click it as part of the recording no step is recorded

A: The close window button is not part of the page, it is part of the browser application so it is impossible to record clicking on it.

In javascript, there is a way (window.close();) to close a window that was opened with a window.open() javascript command but even this method will not work in some versions of Chrome, will not work in FireFox, and IE might prompt for confirmation.

If the window was not opened using windows.open() then there is no way to close it using javascript. But, you can try in your script the below:

Eval in Browser | "window.open('','_self').close();"


Problem: What if Close window API is not working in the script?

Solution:

As per research and latest spec of window.close()

Ordinary javascript cannot close windows willy-nilly. This is a security feature, introduced a while ago, to stop various malicious exploits and annoyances.

From the latest working spec for window.close():

The close() method on Window objects should, if all the following conditions are met, close the browsing context A:

The corresponding browsing context A is script-closable.

The browsing context of the incumbent script is familiar with the browsing context A.

The browsing context of the incumbent script is allowed to navigate the browsing context A.

A browsing context is script-closable if it is an auxiliary browsing context that was created by a script (as opposed to by an action of the user), or if it is a browsing context whose session history contains only one Document.

This means, with one small exception, javascript must not be allowed to close a window that was not opened by that same javascript.

Example:


Problem: How to handle multiple windows in browser without closing any window?

Solutions: Using selectWindow – its not necessary to always use the title/name of window , we can also use href to uniquely identify the window. So in that case it might be easy to handle multiple windows for the flow without closing the window.


Last updated: June 26, 2023

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

Manage Multiple DPL Data Sources in Scenario Editor

We can add multiple DPL files in Test Designer IDE. Once the user adds one of the DPL files in Data tab User can still add other DPL files if any with the help of API that is already available for Hash DPL and JS DPL.

7lwJui1HwOA6Qygr-1e65b68de430.png

With the help of the above API called “Add Hash DPL” and “Add JS DPL”. User can add multiple DPL’s in the IDE.

Below is the screenshot for the successful execution of the same

uy9uNj6P5ZeGSdFW-250402dee2ab.png

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

Last updated: October 16, 2026

How to handle pop-ups in a website using designer?

The user will not be knowing when exactly the window might be popped up and has to handle the popup with an if condition so that, if a particular message or a link or an image is present in the popup and the user recognizes that particular element and has to take necessary decisions. Here is an example for the mentioned situation and its implementation in Appvance Designer.

Consider user navigates to www.appvance.com. The user might get a pop up sometimes and sometimes not. Hence we have used an If condition with the Appvance Designer API (_isVisible_Heading("Sign up for email updates")) which returns the Boolean value based on the presence of the heading "Sign up for email updates". If the condition is true, then the further actions are performed on the popup and if the condition is false, the span of If condition is skipped for further continuation of the script.

Here is the script attached for the above mentioned example

Popup.ds


Last updated: October 16, 2026

Validate Toast Messages in Scenario Editor

To hold toast message _eval("hold_toaster = setInterval(function() { $('.toast-message').mouseenter() })")

To free toast message _eval("clearInterval(hold_toaster);$('.toast-message').mouseleave()")

Note: “toast-message“ is a class name. If toast message is getting disappeared after click some element of toast message then no need to use a step to free toast message

l9TjhDeJCaCWD7Mo-d7a1bfaf6e49.PNG

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

Last updated: October 16, 2026

Parameterize File Uploads in Scenario Editor

Question:

How to parameterize files for the file upload feature? (Like we have a random set of files as test data for upload)

Attached is the Test designer script and associated files that can be used for testing which was created on a public-facing site.

This example has files (5 different files) that are followed by numbers like filename1, 2, and so on.

By making use of Math.floor, we can generate random numbers as needed and can be passed to grab the files on the run, this way every time it runs, it will generate a random number, and based on the generated number, it will pick up the file from the resources.

Below is an example screenshot for test designer steps.

TCCTBiaKgkTIZ8Vc-5e3a5a444784.png

This file contains a sample script: FileUpload.zip


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

Last updated: October 16, 2026

Read and Write CSV Rows for Scenario Editor Data

var Account = readCSVListHashMap("{ds}/Account.csv");
var ini=0;
var i=0;
var $data = new Array();
$data.push(["Email", "Password","PhoneNumber","Date","Month","Year"])
while (ini<Account.length){
var Email=Account.get(ini).get("Email");
var Password=Account.get(ini).get("Password");
var PhoneNumber=Account.get(ini).get("PhoneNumber");
var Date=Account.get(ini).get("Date");
var Month=Account.get(ini).get("Month");
var Year=Account.get(ini).get("Year");
log(Email);

var file="{ds}/Result.csv";

$data.push([Email,Password,PhoneNumber,Date,Month,Year])

var ini=ini+1;
};
writeCSV(file, $data);

IqD9oqu8oK0NjiNr-80963ebedec8.png

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

Last updated: October 16, 2026

Normalize Extra Spaces in Scenario Editor Values

Text1.replace(/ {1,}/g," ")

The g at the end of the RegExp means: global, ie match and replace all occurrences.

P2pIVE7c1Z75X75n-fb2b98361f0b.png

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

Last updated: October 16, 2026

Retrieve Page Elements in Scenario Editor

Please use the following line of code in test designer IDE that will log all the elements on a given page.

getTagsSmartTags() API will get all the elements of a web page.

yZf1IpGyTsmX6rEz-5c209fdb7294.png

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

Last updated: October 16, 2026

Retrieve Numeric Values from Text

Suppose there is a pop-up like below which has a combination of text and Numbers and if we want to retrieve only Numbers

37Vl6TyTQQZrwln0-4a8abfd1470a.png

Then we can use the below code to fetch only Numbers

Store the content into a variable and apply to replace(/[^0-9]/g, "") to the string and it will fetch only Numbers present in the string

Code Snippet

2A27FJYuVkkC7Kzj-707078d81a01.png

Logs from DS3

mk20zD2tAxibziLH-9c5945c2b1fe.png

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

Last updated: October 16, 2026

Extract Text Between Delimiters in Scenario Editor

var str="Cart saved as Quote No :14393430*";

var mySubString = str.substring(str.lastIndexOf(":") + 1,str.lastIndexOf("*"));

You can use the below code to retrieve the value between ":" and "*"

BDBNyihWyQShWUbL-60fac5df3bd2.png

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

Last updated: October 16, 2026

Legacy Sahi Logging Guidance

While I am running sahi/designer based vusers in Appvance IQ, sahi logs are taking up lot of disk space (sometimes 100 GB in 3 to 4 days).
How can we disable the traffic logs that are written to this folder?
/AIQ/sahi/userdata/logs/traffic

Solution:
Kill all java process, Start sahi dashboard alone in the below given path.
Please try disabling the traffic logs by launching sahi dashboard(/AIQ/sahi/userdata/bin/start_dashboard.bat).

Restart Appvance IQ.

6VeK0OVZvKKmo88K-90efb041d7f9.png


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

Last updated: October 16, 2026

Trim Text Values in Scenario Editor

For example: Need only " 14393430" from the string "Cart saved as Quote : 14393430" use the below function:

var quote = "Cart saved as Quote : 14393430"

var quotenum=quote.substring(quote.indexOf(':') + 1)

tlo62WWTkc4IvR2i-829e426753e8.png

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

Last updated: October 16, 2026

Use Custom JavaScript Helpers in Scenario Editor

  1. We are calling the JS function from the DS script and it returns the values after evaluation

The JS function that we have created is shown below

VsgzdZafeZ0RjkPU-b2d15578a9c8.png

This function will calculate a 10% discount on a Price that is entered. The usage of function in TD script is shown below

JkhfWQs0WC8KPKta-40fab5636b65.png

2. We can also make use of the Custom JS action in DS and then fetch the value using the locker

wDmjsG6bgaEnIwTN-08ddc2c4dee9.png iCCjRRJftNCxa0No-c20497d428ee.png

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

Last updated: October 16, 2026

Validate Video Playback in Scenario Editor

_eval('document.getElementsByClassName("jw-video jw-reset")[0].currentTime')

Look for the Video tag in the DOM and use the class or id of it.

Rt6Sb9OGcMJDZSpz-2431f46c8e6f.png eKUJDcGRW7tY3Sy1-d7d4a3ef2615.png

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

Last updated: October 16, 2026

Verify Checkbox Checked and Unchecked States

Use this article when a Scenario Editor validation needs to confirm whether a checkbox is selected or cleared.

Validation workflow

  1. Inspect whether the checkbox is native HTML or a custom UI control.
  2. Validate the correct state attribute or property for checked/unchecked behavior.
  3. Replay the step after toggling the checkbox both ways to confirm the assertion fails and passes correctly.

Last updated: September 28, 2026

How to verify Sorting Functionality

You can use a JavaScript function to verify whether the values displayed in a table are sorted in ascending or descending order.

The following example retrieves the values from a table column, stores them in an array, and compares each value with the next value to determine the sorting order.

function Sortingverify()
{
    var rowlength = _eval("ds$('tbody tr').length");

    log(rowlength);

    var i = 0;
    var values = [];

    while (i <= rowlength - 1)
    {
        var cellClassName = "slds-truncate uiOutputTextArea[" + i + "]";

        assertExists(span(cellClassName));

        values.push(getText(span(cellClassName)));

        i = i + 2;
    }

    log("Number of values: " + values.length);

    if (values.length > 0)
    {
        sortCheck(values);
    }
}

function sortCheck(arr)
{
    var ascending = true;
    var descending = true;

    for (var i = 0; i < arr.length - 1; i++)
    {
        log("Comparing: " + arr[i] + " and " + arr[i + 1]);

        if (arr[i] > arr[i + 1])
        {
            ascending = false;
        }

        if (arr[i] < arr[i + 1])
        {
            descending = false;
        }
    }

    if (arr.length == 1)
    {
        log("Only one row exists.");
    }
    else if (ascending && !descending)
    {
        log("Ascending order.");
    }
    else if (descending && !ascending)
    {
        log("Descending order.");
    }
    else if (ascending && descending)
    {
        log("All values are the same.");
    }
    else
    {
        log("Values are not sorted.");
    }
}

How it works

  1. The script determines the number of rows in the table.
  2. It retrieves the values from the target column and stores them in an array.
  3. Each value is compared with the following value.
  4. The script determines whether the values are:
    • Ascending — each value is less than or equal to the next value.
    • Descending — each value is greater than or equal to the next value.
    • All the same — all values are identical.
    • Not sorted — the values do not follow a consistent order.

For example:

Apple
Banana
Orange

returns:

Ascending order.

While:

Orange
Banana
Apple

returns:

Descending order.

If the values are:

Apple
Orange
Banana

the script reports:

Values are not sorted.

Note: The i = i + 2 increment is specific to the DOM structure used by the original example. If the target page uses a different HTML structure, the selector and increment may need to be adjusted accordingly.


Last updated: August 17, 2026

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

Verify Disabled Buttons in Scenario Editor

To verify the disabled button where XML syntax is like below:

<button type="button" disabled>Add Comment</button>

Use the below code to verify disabled:

sv0i13TlUEGF7EtZ-a93070a99bca.png

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

Last updated: October 16, 2026

Include functionality in Appvance Designer

p>

Latency in AssertExists.

We need to do load testing of our web page. I have a designer script that checks 30 components on the page using assetExists. Appvance is taking up to 1 second to perform each assert check so using it for load testing is not feasible. The assert check should take microseconds to complete.

Response:

In an assertexists, Appvance IQ waits until the page is settled to guarantee the element is present.
This is so at any load the script is still valid.



Last updated: October 15, 2026

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

Log Specific Errors During Scenario Execution

Use this article when a Scenario Editor test needs to capture targeted errors for debugging or reporting.

Validation workflow

  1. Decide which error condition needs explicit logging and where it occurs in the scenario.
  2. Log the minimum useful context: step name, data row, expected value, actual value, and relevant output.
  3. Review execution output to confirm the log helps diagnose the failure without exposing sensitive data.

Last updated: September 29, 2026

Pagination - How to search items in a page with multiple paginations

If you want to search for a specificstring, "Testappvance15860" for example, and if is not found then it should click on the next page.

z3a5h8PDGW6xmHVE-9fcf4cf12d40.png

TmUwk5zt2lqOfOSx-3e2c213c00fe.png

The Js Code is given below


var Job=isVisible(link(Jobname));var Pagination=2;log(Pagination.toString());while (Job==false){click(link(Pagination.toString()));var Job=isVisible(link(Jobname));var Pagination=Pagination+1;}click(link(Jobname));





Pagination assumptions

Set Jobname to an accessor that is unique on the target page and initialize Pagination to the first page link used by the application. Add a termination condition when the site can exhaust its pages without finding the item; otherwise the loop can continue indefinitely. Validate the script against the application’s actual pagination labels and disabled-state behavior.

Last updated: October 15, 2026


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

Self-Healing Questions for Scenario Editor

  1. Could we have a list of what actions are included in self-healing, please?

  2. I’m a little unsure why Assert Contains text can be included within self-healing but Assert Equal / Contains can’t be, could this be explained?

  3. If it is the way that it’s coded could we look at alternatives, for example, could we have an Assert contains an option for attributes i.e. Assert Contains href.

  4. Is it possible to include more complex actions that would self-heal? i.e. “Assert text and store value”

Responses:

Below list of assessors that can be SelfHealed:

The two asserts that can be self-healed are bolded above, assertContainsText and assertDoesNotContainText.

Regarding #2: Self-healing can only update assessors. Assert equal uses a value and does not use an assessor. You would normally store “validatethisnumber” then you would assert equal “validatethisnumber” with a value of “5” or whatever the number is. Here is a screenshot example:

Where you store a “value” in this case the name is submitdis. Then you assert equal to the value that you stored.

The same logic applies to assert contains, but slightly different. Assert contains works similar to assert text, however only looks for something inside a stored value.

Note that the usual use case for this action follows the above screenshot where you store a value with text. Then you can assert contains text inside what you stored. It's similar but different to assertContainsText and the reason why it can't self-heal is that assert contains uses a value as an assessor (or stored element) whereas assertContainsText uses an assessor.

Regarding how you can make more complex actions that could self-heal. I have an idea that will allow you to have more dynamic scripts and allow for more change, but won't be self-healed. The solution to the problem is creating SmartTags. Essentially telling AIQ that the element on the page is recognized as a value. Instead of having 1 set assessor, you could create a SmartTag that would pick up all assessors that look similar to “SmartTag 1” and allow your scripts to become more dynamic as you test without having to manually update all your assessors for your assert statements. It will just assist in picking up elements on the page without updating. Again, this is not Self-Healing but would improve the functionality of your scripts by making them more dynamic allowing for less maintenance (purpose of Self-Healing).

I had a meeting with our lead developer about your use case asking for more complex actions that would self-heal. He said at this moment we don’t currently support it, and it would be a major project to add self-healing to more assert’s as we would need AI deep learning to automatically pull assessors from the page that doesn’t currently exist. In the future, it's definitely a possibility, but at this moment and in the near future we don’t see this as a feature we will be able to support. We agree 100% that it would be awesome to include, just a massive project to start and finish.


Last updated: August 25, 2023

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

Regular Expression in Appvance Designer.

Query:
We need a generic statement for the below accessor.
cell("AddImage/Attachment for Issue # 40")
As in the 40 will be replaced by any random number.
Solution:
Here are some of the reg ex that you can give a try.
cell("AddImage/Attachment for Issue #/")
cell("AddImage/Attachment for Issue/")
cell("AddImage/")
cell("AddImage/Attachment for Issue #/[0-9]/").

Last updated: June 02, 2023

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

Solutions to common Test Designer IDE Challenges

Most of the times click and record can solve your testing needs. But also it is not rare that due to the “scripting” oriented description of the use cases to implement, the tester is faced with the challenge to approach the automation from a scripting angle.

This document provides some examples of scenarios where a little coding like steps are needed to speed up some automation requirements implementation using IDE.

If you are facing AI automation challenges please take a look at Useful smartags workbench custom actions and other js examples.

Solutions to Common Test Designer IDE Challenges

Numbers: convert parts of a string value to a floating number

// Suppose you have a span with the value $19.99 but you need validate the number is greated than 15.
Store                |  $stringValue    |  getText(span("carttotal"))     // "$19.99"Store                |  $floatingValue  |  parseFloat($stringValue.substring(1))   // removes the $ then convertes "19.99" to a floating number 
Assert Greater Than  |  $floatingValue  |  15

Numbers: convert a string value to an integer number

// When needing to perform math operation so often you need to convert a number in string format to an actual integer 
Store   |   $integerValue   |   parseInt(span("item-quantity"))


Tables: getting the number of rows in a table using ds$

// Assuming the table has an id myTable you can get the number of rows in the IDE using: 
Store  |  $rowsQuantity  |  _eval("ds$('#myTable tbody > tr').length")
or
Store  |  $rowsQuantity  |  getLength("ds$('#myTable tbody > tr')")

An alternate way is to use the getLength function:

// Assuming the table has an id myTable you can get the number of rows in the IDE using: 
Store  |  $rowsQuantity  |  getLength("#myTable tbody > tr")

Tables: getting the column index with a given header using ds$

// You can use the jQuery index() function to find the column index of a table that contains certain text "MyHeader". REF: https://api.jquery.com/index/
Store  |  $columnIndex  |  _eval("ds$('thead th:contains(MyHeader)').index()")+1

Tables: Iterate over a table to process all the cells values of a given column using ds$

// If you need to iterate over a table column to process the contents of a certain column you can use above functions to get the total number of 
// rows in the table and the column that has the appropiate heade and then:
Store   |  $rowIndex                  | 1
While   |  $rowIndex < $rowsQuantity
  Store |  $cellValue                 |  _eval("ds$('tbody tr:nth-child("+$rowIndex+") td:nth-child("+$columnIndex+")').text()")
  [ do something with $cellValue ]
  Store |  $rowIndex                  |  $rowIndex + 1
End While

General: close browser window.

// If the application does not provide a button to close the window, need to insert
// the link and click it with following lines. 
CustomJS  |  "ds$('body').append('<a id=\"aiq-close\" href=\"javascript:close_window();\">aiq-close</a>')"Click     |  link("aiq-close")

General: get an attribute value of an element

Store     |   $url   |  getAttribute(link("id"),"href")

General: confirm an element is disabled

Set FindOnlyEnabled  |  false      | 
Store                |  submitdis  |  getAttribute(button("cancellation-submit"),"disabled")
Set FindOnlyEnabled  |  true       | 
Assert Equal         |  submitdis  |  "disabled"

General: get a dynamic value and use it elsewhere

Get from Whiteboard |  $caseNum                 | "CaseNumber"Click               |  link("Case Search")      |
Set Value           |  textbox("form-control")  | $caseNum
Click               |  submit("Search")         |  
Store               |  caseName                 | getText(cell(1,_near(span(["caseNameLabel"]))))
Click               |  link($caseNum)           |
Select Window       |  caseName                 |

Last updated: July 03, 2023

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

Group Step Statistics at a Higher Summary Level

Problem statement -
Consider a single test in AIQ.

We have a *group* of steps that we would like to treat as a single entity in reports. I’ll use login as a simple example for this conversation.

Instead of getting performance information for each individual step like this in a report:

//start login

Enter Username- 1ms

Enter a password- 1ms

Click submit -500 ms

//create new residence

More steps for more testing that a residence was created

//delete residence

More steps for more testing that a residence was deleted

We would like to generate a more “management friendly” report that has numbers that are grouped and summed by section/entity.

Login – 502ms

Create residence – 1203ms

Delete residence – 3212ms

Most readers don’t view actions as mouse clicks and field interactions. They think in notions like the second report.

Resolution:

The steps can be grouped by making use of the below

com.appvance.enterprise.tool.APCStepListener.startSummaryStep("Start Login")

com.appvance.enterprise.tool.APCStepListener.endSummaryStep()

Below is the code snippet from test designer IDE

Equivalent JS script:

com.appvance.enterprise.tool.APCStepListener.startSummaryStep("Login");
navigateTo("https://demosite.appvance.com/");
click(link("Login"));
setValue(emailbox("spree_user[email]"),"user@company.com");
setValue(password("spree_user[password]"),"Password");
click(submit("commit"));
com.appvance.enterprise.tool.APCStepListener.endSummaryStep();
com.appvance.enterprise.tool.APCStepListener.startSummaryStep("Shop by Categories");
navigateTo("https://demosite.appvance.com/");
click(link("Bags"));
click(link("Mugs"));
click(link("Clothing"));
com.appvance.enterprise.tool.APCStepListener.endSummaryStep();
com.appvance.enterprise.tool.APCStepListener.startSummaryStep("Shop by Brands");
click(link("Ruby"));
click(link("Apache[1]"));
click(link("Spree"));
click(link("Rails"));
com.appvance.enterprise.tool.APCStepListener.endSummaryStep();

Reports can be filtered this way to get to those steps that are required.


Last updated: July 28, 2023

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

Test Designer 3: HTML5 and Web Application Compatibility


Test Designer 3 supports modern HTML5-based web applications and many of the technologies commonly used to build interactive web applications.

HTML5 introduced new HTML elements, attributes, APIs, and browser behaviors, while the broader modern web platform includes technologies such as JavaScript, CSS, browser APIs, and client-side frameworks.

For additional information about HTML and the web platform, see:

HTML5 Compatibility

Test Designer supports most commonly used HTML5 features. However, compatibility can depend on how an application implements its UI components and JavaScript event handling.

Modern web applications can trigger actions through multiple mechanisms. For example, an application may use standard browser events, JavaScript event handlers, CSS pseudo-classes, custom components, or framework-specific event processing.

As a result, an action that works with a standard HTML element may behave differently when the same functionality is implemented through a custom component or JavaScript framework.

Click Actions

Test Designer provides multiple methods for interacting with clickable elements, including click and click2.

In most cases, the standard click action is sufficient. However, some applications implement additional JavaScript behavior or custom event handling that may require an alternative click method.

For example, an application may perform additional processing through JavaScript or use CSS pseudo-classes and framework-specific event handlers.

For more information about CSS pseudo-classes, see the MDN CSS pseudo-classes documentation.

If a standard click action does not produce the expected behavior, try the alternative click method or use an action specifically designed for the application's implementation.

File Upload

HTML5 does not prescribe a single implementation pattern for file-upload interactions across all web applications.

Applications may implement file selection using standard HTML elements, JavaScript, custom components, or framework-specific controls.

To accommodate these implementations, Test Designer provides multiple setFiles methods. The appropriate method depends on how the application's file-upload component is implemented.

If a file-upload action does not work as expected, verify the underlying HTML element and the application's JavaScript implementation, then select the appropriate setFiles method.

Authentication Support

Test Designer supports the following authentication mechanisms:

AIQ Authentication

Authentication to the AIQ application itself can be configured using:

These authentication mechanisms are separate from authentication used by the web applications being automated.

Record and Playback Considerations

Test Designer uses browser instrumentation and injection mechanisms to provide recording and playback capabilities.

Certain application security mechanisms can interfere with these capabilities.

Man-in-the-Middle Detection

Applications or security tools that detect man-in-the-middle (MITM) activity may prevent Test Designer from recording, injecting, or interacting with a page correctly.

If an application uses certificate pinning, traffic inspection, or other mechanisms designed to detect intercepted browser traffic, additional configuration may be required.

Browser Certificate Validation

Test Designer may use certificates as part of its browser instrumentation and traffic interception mechanisms.

Depending on the browser and application configuration, certificate validation can prevent a page from loading correctly or cause the browser to display certificate warnings.

For example, browsers may reject certificates that do not match the certificate expected for a particular domain.

If a page displays an invalid-certificate error when accessed through Test Designer, verify the browser certificate configuration and the application's security policies.

JavaScript Framework Support

Test Designer 3 has been tested with commonly used JavaScript frameworks and web technologies, including:

Support for a framework does not necessarily guarantee compatibility with every application built with that framework.

Framework implementations can vary significantly, and applications may use custom components, third-party libraries, proprietary event handling, or newer framework versions that behave differently from the versions originally tested.

Compatibility Considerations

Although Test Designer is designed to support modern HTML5 applications and commonly used web frameworks, compatibility can depend on several factors, including:

New framework releases, major version changes, forks, and highly customized implementations may require additional validation.

When an application does not behave as expected, first determine whether the behavior is specific to the application's implementation or to the underlying framework.

Support and Feature Requests

Appvance continuously evaluates compatibility with modern web technologies and commonly used frameworks.

If you encounter a web application that does not behave as expected in Test Designer, provide the relevant application details, the Test Designer action being used, and the observed behavior when submitting a support request.

Feature requests and compatibility issues can be submitted through the available Appvance support channels.


Last updated: August 25, 2026

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

Use Relative File Paths for Scenario Editor Uploads

setFile action in designer is used to set a file in the file input field.
Form elements of type "file" cannot be populated using javascript on the browser.
Appvance designer has a workaround for handling file uploads, designer intercepts the request in the proxy, reads the file off the file system and inserts it into the multi-part request.

The file has to be present on that path on the machine running Appvance AIQ.

By using relative paths, the files can be sent to all the test node machines running Appvance AIQ so the files need not be moved to all the testnode instances.

Below designer script example shows the same:

Scenario: Image need to be uploaded to my web application and need to run performance test on several test nodes without moving the files manually to all the test node machines.

Images or any folder was created in the same place as the designer script, in my case 'FileUpload.ds' script is located in /Appvance AIQ/MyScripts folder and a folder by name 'Images' was created inside MyScripts folder.

Designer:

Scenario Builder:

Note: In the locations panel, user can provide any location to run this particular scenario or can use the cloud files to initialise any cloud machine and run the scenario, all the resource files will be copied over to the test node machines!



Last updated: June 26, 2023

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

Use Looping Patterns Safely in Scenario Editor

Attached example designer script will show how to use while loop in designer script.

whileLoop.ds


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

Last updated: October 16, 2026

Using writeCSVFile API in Sahi.

Below code example shows how to use writeCSVFile API.

_navigateTo("http://localhost:8080/Appvance/login.html");
_setValue(_textbox("username"), "appvance");
_setValue(_password("password"), "appvance");
_click(_submit("Login"));
//user function
var htmlelement1 = "username";
var value1 = "appvance";
var htmlelement2 = "password";
var value2 = "appvance";
//capture elements and write to CSV
var array = [[htmlelement1,value1],[htmlelement2,value2]];
_writeCSVFile(array, "elements1.csv", true);
//another way of declaring array and writing to CSV
var $datatowrite1 = [];
$datatowrite1[0] = [htmlelement1,value1];
$datatowrite1[1] = [htmlelement2,value2];
_writeCSVFile($datatowrite1, "elements.csv", true);
_writeCSVFile($data, "userinfo.csv", true); // overwrites data into userinfo.csv
To get value of some element below step can be used.
var value1 = "_getText(_div("/someclass/"))";

===============================================
writeFile
_writeFile("Value", "FilePath"); // appends second line in file

Last updated: October 15, 2026

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

Working Around Asynchronous Popups

p>

Which JavaScript version is supported?

GraalVM JavaScript implements JavaScript as prescribed in the ECMAScript (ECMA-262) specification. It is fully compatible with the ECMAScript 2021 specification (sometimes referred to as the 12th edition or “ES12”).


Last updated: October 15, 2026

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

Browsers Not Listed When Clicking Record

Issue

When you click Record in Test Designer, the expected browsers are not listed.

Solution

1. Verify the browser paths

Make sure the browser executable paths configured in Test Designer are correct.

  1. Open the config folder in your local Test Designer installation:
    TestDesigner/NetworkProxy/config
  2. Locate and open the global.json file.
  3. Find the browser and platform that are experiencing the issue.
  4. Verify that the configured browser executable path matches the actual location of the browser executable on your system.
  5. If the path is incorrect, update it to the correct browser installation path.

2. Restart Test Designer as Administrator

After verifying or updating the browser paths:

  1. Close Test Designer.
  2. Restart Test Designer using Run as administrator.
  3. Click Record and verify that the expected browsers are now listed.

Last updated: August 19, 2026

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

  1. Make sure the browser paths are correct. Open the /TestDesinger/NetworkProxy/config folder inside the Test Designer local installation and find the global.json. Scroll down and find the browser and platform that is giving problems. Verify that the listed paths for the browser executables are matching the browser program location in your system.
  2. Restart Test Designer as Admin.

Handle Browser Location Permission Prompts

How to achieve or handle location permission pop-ups in AIQ.

  1. Stop test designer

  2. Navigate to "\TestDesigner\NetworkProxy\config\Chrome" in your installation.

  3. Take backup of the "AllowDownloads.json" file by renaming it.

  4. Create a new version of "AllowDownloads.json" file in "\TestDesigner\NetworkProxy\config\Chrome" using the following code:

    AllowDownloads.json
    {
                                "credentials_enable_service": false,
                                "profile": {
                                "managed_default_content_settings":{
                                "geolocation": 1
                                },
                                "default_content_setting_values": {
                                "automatic_downloads": 1,
                                "geolocation": 1
                                },
                                "default_content_settings":{
                                "popups":0
                                },
                                "cookie_controls_mode": 0
                                },
                                "download": {
                                "directory_upgrade": true
                                },
                                "partition": {
                                "default_zoom_level": {
                                "x": 0
                                }
                                },
                                "devtools": {
                                "preferences": {
                                "jsSourceMapsEnabled": "false"
                                }
                                }
                            }
  5. Start test designer

  6. Login to AIQ and launch your script in playback mode in Chrome.


Last updated: June 26, 2023

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

Validate Downloaded Files in Scenario Editor

The solution to this is using a function known as getDownloadedFiles(). This particular function is used to get the downloaded files. It can be passed through a variable. This function can be used as shown below:

var [] filedownloadedList = getDownloadedFiles(),

To get the file path from the downloaded list, use as below:

var filepath = fileDownloadedList.getJSONObject(0).getString("path")

where “fileDownloadedList” is a variable that has been used to store the downloaded file. This function is fetching the path of the downloaded file and stores it in a variable.

rV8pErkkwpBlOzmO-aecb597b9bb4.png

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

Last updated: October 16, 2026

Self-Healing Support in Scenario Editor

Enabling self-healing builds out an accessor repository for each script step. Should an accessor change permanently, AIQ will recommend substitutes based on learning from prior runs and replace the accessor in the script (self-heal the script) for you.

The following accessors can be self-healed:

For more information on self-healing, see the “Self-healing” section in Creating Blueprints.


Last updated: June 15, 2023

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

Authentication Mechanisms in AIQ Tests

Design authentication in AIQ tests so credentials, sessions, tokens, and test accounts are controlled, repeatable, and safe to use. Authentication steps should reflect the application under test and should not expose passwords or tokens in documentation, logs, screenshots, or scenario code.

Common approaches

Best practices

  1. Use dedicated test accounts instead of personal or production accounts.
  2. Store secrets in approved secure locations, not in visible steps or shared notes.
  3. Validate multi-factor, SSO, captcha, or conditional-access requirements before automation.
  4. Clear sessions when tests must start from a known state.
  5. Document account role, environment, and cleanup expectations without revealing credentials.

Last updated: October 6, 2026

Handle Validation Failures and Continue Scenario Execution

Problem

As a user, I want to report on validations which fail, but I’d also like to use workaround steps if possible to move past the error when it occurs.

Resolution

Create a validation which also includes the steps to overcome the issue and move forward.

Verification Snippet

var visibilityResult = isVisible(small(["Enter valid Date of Birth"]));
if (visibilityResult){    	
  setValue(textbox('DateofBirthMask'),'01011955');
};
assertFalse(visibilityResult);

Explanation

  1. Check if something is visible

  2. If it is visible, then proceed with workaround step(s)

  3. Then return a verification failure if the item checking for was visible using assertFalse(visibilityResult);

Many other asserts types exist. For a complete list, see Assert and Verify Functions.

Why is the assertion last?

Steps

Option A: Example Using SmartTag Validations

For additional information about SmartTag Validations see Validations in SmartTag Workbench.

SmartTag Validation Assignment

SmartTag Validation Post-Action Trigger

SmartTag Validation Usage

This SmartTag automatically triggers when a Test Designer IDE script, JS Edit & Play script or AISG uses the svBtnAddToList SmartTag.

Option B: Example using Validation Workbench

Validation Configuration

Validation Usage

The Trigger by type in this example is a Manual Call, allowing you to call the validation from a script or AISG simply using Validate as follows:

For additional information about triggers see “Trigger By:” in Validation Workbench


Last updated: August 25, 2023

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

How can use a wild card when part of the identifier is always changing?

Question

How can I use a wild card when part of the identifier is always changing?

How can I find an object, if part of the name is always changing?

Resolution

A quick way to work with accessors, or objects where a portion of the name or attribute is dynamic, is to use the Fuzzy Logic syntax. By simply enclosing the string in quotes with [ ], AIQ will treat that portion as a contains search, and not require a complete match.

Read more about Fuzzy Logic in our documentation

Example 1

Given an object recorded as span("person testuser")
Where testuser matches the name of the logged in user
The Fuzzy Logic syntax would be span(["person"])

Example 2

Need more complex pattern matching? Learn how to use Regular Expressions here


Last updated: October 15, 2026

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

SmartTags: Using a custom getName Method

Problem

As a user, I want to customize how AIQ finds and interacts with a specific element type in my application

Resolution

Teach AIQ how to best identify and interact with your specific element type using SmartTag Rules and Actions.

Knowledge Base Articles

Documentation

Using a custom getName Method

getBestName (option a)

This Action contains a prioritized list of attributes listed within the arr array variable. The first match is returned, or UNKNOWN is returned if no valid attribute value is found.

var theElement = ds$(element);
// attributes to try and in a given order
let arr = ["name", "placeholder"];
for (let i = 0; i < arr.length; i++) {
	try {
    var accessorValue = theElement.attr(arr[i]);
    if (typeof accessorValue !== 'undefined') {
      accessorValue = accessorValue.trim().replace(/(\r\n|\n|\r|\t)/g,"");
      break;
    }
  } catch(e) {
   // maybe the element doesn't contain the attribute
  }
}
if (typeof name === 'undefined') {
     accessorValue = "UNKNOWN";
}
return accessorValue;

getBestName (option b)

This Action contains a prioritized list of attributes, which returns the first attribute containing a valid value as the method for locating the object.

var htmlElement = ds$(element);
var name = htmlElement.attr('id');
if (typeof name === 'undefined') {
  name = "";
}
if (name === "") {
  name = htmlElement.attr("text");
}
if (typeof name === 'undefined') {
  name = "";
}
if (name === "") {
  name = htmlElement.attr("name");
}
if (typeof name === 'undefined') {
  name = "";
}
if (name === "") {
 name = "UNDEFINED"; // if nothing works, clearly denote as UNDEFINED
}
return name.replace(/(\r\n|\n|\r|\t)/g, "").trim();

How can I use this?

Create a SmartTag to use the getBestName action: When combined with a SmartTag, this example overrides the default getName method using an Action for input type fields, but only those matching the Rule, which specifies a specific class. The Action defines a specific approach to locating and naming the Input object separate from the default Accessor Preferences.


Last updated: July 03, 2023

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

Maximizing the number of concurrent browsers

For performance testing, you can increase the number of concurrent Chrome browsers that can run on an AIQ Test Node by optimizing the node's compute and storage resources.

The maximum number of concurrent browsers depends on the application under test, the complexity of the test, browser activity, available CPU and memory, and storage performance.

As a general starting point, an AWS EC2 node using standard EBS storage may support approximately 20 to 30 concurrent Chrome browsers. Higher concurrency can be achieved by using EC2 instance types that provide local NVMe SSD instance storage and by configuring AIQ to use that storage.

Important: These numbers are guidelines, not fixed limits. The appropriate browser count must be determined through performance testing with the application under test.

Using NVMe SSD Instance Storage

Storage I/O can become a bottleneck when running a large number of concurrent browsers. Browser processes generate significant disk activity, including cache and temporary-file operations.

AWS EC2 instance types such as the m6id family include local NVMe SSD instance storage. For example, current AWS specifications list:

These NVMe SSD volumes provide substantially higher I/O performance than typical baseline EBS configurations.

Important considerations

NVMe instance storage is ephemeral. Data stored on an instance store volume persists only for the lifetime of the associated EC2 instance. It should therefore be treated as temporary working storage rather than permanent storage.

AIQ files, configuration files, or other data that must survive an instance stop or termination should remain on persistent storage.

Because the NVMe storage is not persistent, the node must prepare the storage and copy the required AIQ files to it each time the instance is initialized.

Configuring AIQ to Use NVMe Storage

The script should:

  1. Detect and mount the available NVMe instance-store device.
  2. Copy the GraalVM installation to the NVMe storage.
  3. Copy the aiq_distribution directory to the NVMe storage.
  4. Configure Chrome to use a local cache directory on the NVMe storage.
  5. Start AIQ from the NVMe storage.

The Chrome configuration can be added to:

aiq_distribution/NetworkProxy/config/global.json

Add the following configuration:

{
  "name": "experimentalDS3",
  "value": "--disk-cache-dir=cache||--disk-cache-size=1"
}

This configuration redirects the Chrome disk cache to the local storage used by the AIQ node.

Setting Up an AWS EC2 Performance Node

1. Prepare the NVMe setup script

Add the nvme_setup.sh script to the AIQ distribution on the EC2 instance.

The script should detect the available NVMe instance-store volume, mount it, and copy the required AIQ and GraalVM directories to the local storage.

The original script assumes that AIQ is installed in:

/opt/aiq/aiq_distribution

If AIQ is installed in another location, update the script accordingly.

Note: The exact NVMe device name can vary between EC2 instance types and operating systems. The setup script should detect the device rather than assuming a fixed device name.

2. Configure Chrome disk caching

Modify:

aiq_distribution/NetworkProxy/config/global.json

Add:

{
  "name": "experimentalDS3",
  "value": "--disk-cache-dir=cache||--disk-cache-size=1"
}

The cache directory should reside on the NVMe-backed AIQ installation.

3. Start AIQ using systemd

For Linux performance nodes, start AIQ through a systemd service rather than /etc/rc.local.

Using systemd also allows you to increase operating-system resource limits. This is particularly important when running many concurrent browsers because the default per-process file descriptor limit may be too low.

Create:

/etc/systemd/system/appvance.service

Use the following configuration and adjust the paths and Java version for the environment:

[Unit]
Description=Start Appvance IQ services
After=syslog.target

[Service]
Environment=PATH=/opt/graalvm-ce-java11-21.3.3.1/bin:/sbin:/bin:/usr/sbin:/usr/bin
Environment=JAVA_HOME=/opt/graalvm-ce-java11-21.3.3.1
User=ec2-user
Type=simple

LimitNOFILE=10000000
LimitNPROC=20000

ExecStart=/bin/bash /opt/aiq/aiq_distribution/TestNode/nvme_setup.sh
WorkingDirectory=/opt/aiq/aiq_distribution/TestNode

TimeoutStartSec=0

[Install]
WantedBy=multi-user.target

Note: Verify the Java/GraalVM version and installation path before using this configuration. The paths above are examples from the original configuration and may not match the AIQ version installed on your node.

After creating the service, run:

sudo systemctl daemon-reload
sudo systemctl enable appvance
sudo systemctl start appvance

To verify the service:

sudo systemctl status appvance

The original article contains a typo (systemclt enable). The correct command is:

systemctl enable appvance

Resource Limits

When increasing browser concurrency, make sure the operating system can support the required number of processes and open files.

The example service uses:

LimitNOFILE=10000000
LimitNPROC=20000

These values are intentionally high and should be validated against the requirements of the specific environment. Increasing limits does not by itself guarantee higher browser concurrency; CPU, memory, storage I/O, network capacity, and the application under test can all become bottlenecks.

Example Concurrency Results

The original performance testing produced the following results:

EC2 Instance

Concurrent Chrome Browsers

m6id.2xlarge

40

m6id.4xlarge

80

These results were obtained with a Test Designer test case and should be treated as example performance results rather than guaranteed capacity.

Actual concurrency can vary depending on:

For this reason, perform a capacity test before selecting the final number of concurrent browsers for a performance environment.

Amazon Linux Version

The original version of this article specifically targeted Amazon Linux 2.

Amazon Linux 2 reached end of life on June 30, 2026. AWS recommends migrating to Amazon Linux 2023.

Therefore, new performance nodes should use an AWS-supported operating system and the corresponding AIQ installation and startup configuration.

If an existing environment still uses Amazon Linux 2, treat the configuration in this article as a legacy setup and plan migration to Amazon Linux 2023.

EBS Storage Considerations

EBS performance depends on the volume type and its provisioned performance.

For example, Amazon EBS gp3 volumes provide a baseline of 3,000 IOPS and 125 MiB/s throughput, with additional IOPS and throughput available through provisioning.

Therefore, the storage bottleneck should not be described simply as a limitation of a "60 GB EBS volume." When investigating concurrency limitations, monitor the actual EBS IOPS, throughput, latency, and utilization of the node.

For workloads that generate substantial browser disk activity, local NVMe instance storage can be an effective way to reduce EBS-related storage contention.

Troubleshooting and Capacity Testing

If increasing the number of browsers causes execution failures or significantly longer response times, monitor the following resources during the test:

  1. CPU utilization
  2. Memory utilization
  3. EBS IOPS and throughput
  4. NVMe utilization
  5. Disk latency
  6. Network utilization
  7. Number of open files
  8. Number of running processes
  9. Chrome memory consumption
  10. AIQ/Test Node logs

Increase concurrency gradually rather than immediately configuring the maximum expected browser count.

For example:

20 browsers → 40 browsers → 60 browsers → 80 browsers

At each level, verify that the node remains stable and that response times and error rates remain within the requirements of the performance test.


Last updated: September 2, 2026

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

Understand Step Duration Calculations in Scenario Editor

AIQ Test Designer reports durations for steps and requests. Step durations will vary depending on the settings you chose in the Option Timings field in the Scenario Editor.

The timing for some options is provided by the browser's performance navigation timing system, for other options the timing is calculated by the Test Designer engine.

The following timings are provided by the browser performance navigation timing system and are industry standard durations based on >https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming.

The following timings are calculated by the Test Designer engine:

Each of these options are detailed below.

Timings provided by the Browser (Performance Navigation Timing standard)

You can calculate timings by:

  1. Opening a Chrome browser outside AIQ in incognito mode.

  2. Right-click and click inspect in the browser context menu.

  3. Go to the Console and check for the DOM/Full Page/Server Response timings using the below formula for each step.

You will observe that normally


Full Page Loaded > DOM Complete > Server Response Complete

In the screenshots below you can see that for >https://demosite.appvance.com the values for the above durations are:

Full Page Loaded (4022) > DOM Complete (4019 ms) > Server Response Complete (2508 ms)

IMPORTANT:
You might find that durations are less than what you can measure manually using the application. The reason for this is that those timings are not taking into consideration possible asynchronous processes where js code is waiting for the response(s) of a backend calls. For this reason, more calculated durations are provided.

DOM Complete

This duration is provided by the browser. It shows the time immediately before the browser’s user agent sets the >current document readiness to >"complete". (>w3.org)

Note: In single-page steps, this calculation will return 0, but AIQ will display the Next Step Ready duration instead of 0.

window.performance.timing.domComplete- window.performance.timing.navigationStart

Server Response Complete

This duration is provided by the browser. It shows the time immediately after the user agent receives the last byte of the current document or immediately before the transport connection is closed, whichever comes first. The document here can be received either from the server, >relevant application caches, or local resources. (>w3.org)

Note: In single-page steps, this calculation will return 0, but AIQ will display the Next Step Ready duration instead of 0.

window.performance.timing.responseEnd - window.performance.timing.navigationStart 

Full Page Loaded

This duration is provided by the browser. It shows the time when the load event of the current document is completed. (>w3.org)

Note: In single-page steps, this calculation will return 0, but AIQ will display the Next Step Ready duration instead of 0.

window.performance.timing.loadEventEnd- window.performance.timing.navigationStart

Timings provided by Test Designer

When durations provided by the browser do not reflect the time you want to monitor, a few alternatives are calculated by test designer while managing the steps executions.

Script Time

This duration is calculated by AIQ’s Web Designer interacting with the js code injected in the browser. The script time shows the duration between the start of execution step and when the step returns a status of completed to Web Designer.
Most of the time this duration is thecloser to the duration perceived by a person using the application when there are synchronous calls happening after a post submit call(s).

Ajax Timing

This duration is calculated by AIQ’s Web Designer interacting with the js code injected in the browser. The ajax timing shows the duration of the addition of all the requests durations terminating during the execution of the step. Due to the dynamic nature of modern applications, this duration is not very useful. Kept in product for backwards compatibility.

Next Step Ready

This duration is calculated by AIQ’s Web Designer interacting with the js code injected in the browser. The next step ready duration shows the duration between the start of the execution of the step and when the DOM element is detected. This duration is usually very small and is only useful in single-page applications.


Last updated: August 03, 2023

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

Troubleshoot Iteration Summary Error Messages

Scenario

You are trying to download/analyze a report from the Report option and AIQ displays the following message: "An error has occurred while trying to retrieve the test duration. Iteration Summary may not be available or accurate."

Selected Report Option

Message

Solution / Workaround

This situation can happen when the URL of the RDS database server is changed (or even the password), the parameter config=default used to access the reports, needs to be changed with a config=<db-config-hash-number> and then the reports are accessible.

The <db-config-hash-number> can be obtained by inspecting the URL opened by the link “Click here to see reports” seen in the playback-controller.html page when running a scenario. That number does not change unless you change something in the AIQ database URL or DB user creds.

Process

  1. Navigate to the Run Scenario option.

  2. Select the most recent scenario executed and click Show Results.

  3. Click Click Here.

  4. Take the config ID (Copy) displayed in the URL

  5. Navigate back to the Report Option, select the report that is broken, replace the cID displayed in the URL with the one obtained in the previous step, and press <Enter>, the report will be displayed and ready to be analyzed.


Last updated: July 28, 2023

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

Capture and Validate Tooltips in Scenario Editor

Use this article when a Scenario Editor test needs to trigger, capture, and validate tooltip text.

Validation workflow

  1. Identify whether the tooltip appears on hover, focus, or click and whether it is native or custom HTML.
  2. Capture the tooltip text or attribute after the UI has displayed it.
  3. Replay the step with timing checks and confirm the assertion fails when expected text changes.

Last updated: September 29, 2026

How to access two different application at the same time in a single script.

  1. Navigate to any URL Eg: https://demosite.appvance.com/
  2. Perform some steps
  3. Add new action called “Open Tab” and add a URL “https://www.apple.com/ “
  4. Store any value for any element on the page
  5. Use Select Window action and go to 1st URL i.e https://demosite.appvance.com/
  6. Click on the search text field icon on the Appvance Demo site app
  7. Use the Variable on the text field which was stored in the Apple website
  8. You will be able to search with the created variable in 2nd application
  9. User can use Select Window to move Back and Forth in both the applications.

R3o9eovNWKxGUCuK-a2809a9d7a11.png




Window and variable handling

Open the second application in its own tab, store the required value before switching windows, and use the exact window-selection action supported by the script. Keep each application’s locators scoped to its active window; after switching back, verify the target page is ready before using the stored variable. This prevents a value from being applied to the wrong document.

Last updated: October 15, 2026


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

How to find the X Y Coordinates

function alertMousePos(event) {
alert(
"X: " + event.clientX +
" - Y: " + event.clientY);
}
document.addEventListener("click", alertMousePos);

  1. Just copy and paste the above code into the browser’s console and press the ‘Enter’ key.
  2. Now click on wherever on the page- An alert will get displayed with x and y values -- It gets the x, and y coordinates of the click of the mouse pointer. Note - Any console (Normal browser or test designer browser) should work, but advisable to use the Test Designer browser in maximized state.

Last updated: October 15, 2026

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

How to perform Mouse Over action using Toggle Style API From Test Designer

We have the below two APIs to perform mouse over from Test Designer

MouseOver using Toggle Style Action

Add the below step with the accessor which needs to be Mouse over

  1. Select API as Toggle Style from the scripts step
  2. Add the Accessor which needs to mouse over
  3. Add “hover“ in the value column


Example Screenshot

UIGkL2wFfvqOxkEO-ec6cdc47b5ef.png




Mouse-over verification

Use Toggle Style with the target accessor and the value hover when the application exposes the hover behavior through CSS or a related event. Confirm the resulting menu, tooltip, or style change before continuing. If the application requires a pointer event that Toggle Style cannot reproduce, retain the separate Mouse Over API option and document the observed behavior.

Last updated: October 15, 2026


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

Verify Whether a User Exists in the Database

We can achieve this in four steps:

  1. Need a SQL file to retrieve the data from the database

  2. Need a service suite script to run the SQL query and store it in a variable to compare

  3. Need a CSV file that contains the user or users

  4. Implementation in .ds script

For step-1 we have to create a SQL file in the below format:

-- dbvendor=MYSQL
-- username=XXXX
-- password=XXXX
-- host=localhost
-- schema=XXXX
-- port=3306
-- connect
-- limit=1-10
-- tag=executedScenarios
SELECT * from DATABASENAME.TABLENAME
-- storeInLocker=
-- disconnect

For step-2, below are the syntax for service suite script:

processSQLFile("{ds}/sqlScript.sql");
var result = JSON.parse(locker.get("executedScenarios"));
log(result);
var xyz;
locker.put("xyz",result);

For step-3, use any CSV in below format:

For step-4, use the below step


Last updated: August 03, 2023

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

Validate Color of an Object

This is an example of a script that detects the color of a specific object and then uses conditional statements to compare it to a reference color.

Web Designer Script

This is the AIQ designer test script to accomplish this validation. The script uses the GetCssValue function.

See getCssValue for more information about the function.

The example script uses the Appvance demo site. The object that the script is the comparing color of is a footer which contains the price of an item.

Download a copy of this script from: ColorCheckExample.ds

JS Code

For reference, this is the corresponding java script code for the ColorCheckExample test script.

/**
 * @aiq.webdesigner
 * This script requires AIQ Web Designer
*/
setShadowDOM(true);
navigateTo("https://demosite.appvance.net/");
click(fallback(`div(2, _in(div("product_1"))).xy(0.11, 0.58 )`,
   `div(2, _in(div({'id':'product_1'}))).xy(0.11, 0.58 )`,
   `div("panel-footer text-center").xy(0.11, 0.58 )`,
   `div("$15.99").xy(0.11, 0.58 )`,
   `byXPath("//div[@id='product_1']/div/div[2]").xy(0.11, 0.58 )`,
   `byXPath('//*[@class="panel-footer text-center"]').xy(0.11, 0.58 )`,
   `byXPath('/html/body/div[2]/div/div/div/div[2]/div/div/div[2]').xy(0.11, 0.58 )`,
   `byXPath("id('product_1')/div[@class='panel panel-default']/div[@class='panel-footer text-center']").xy(0.11, 0.58 )`,
   `byJQuery('div[class="row"] > div[class="col-md-3 col-sm-6 col-xs-6 product-list-item"] > div[class="panel panel-default"] > div[class="panel-footer text-center"]').xy(0.11, 0.58 )`,
   `byJQuery('#product_1 > .panel.panel-default > .panel-footer.text-center').xy(0.11, 0.58 )`));
var FooterColor=getCssValue(byXPath("//div[@class='panel-footer text-center']//span[@class='price selling lead']"), "color");
log(FooterColor);
if (FooterColor == "rgb(51, 51, 50)"){
   alert("The color correspond");
}
else {
   alert(“Those are not the droids you are looking for");
}

Last updated: February 25, 2025

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

MFA Authentication Automation Guidance

Some webapps you are testing may request an authenticator app short code as part of the login process. Microsoft Authenticator and Google Authenticator are the most commonly used authenticator applications but there are others.

You can configure a third-party service to provide a code when creating a AIQ test designer script to

In order to create a test designer script that automate test use cases over this application, a third party service can be configured configured as the code provider.

Two common third-party services are passwordstate and cyberark.

Configure the Authentication Code in the Application

This steps involves creating a new user in the application you are testing and setting the MFA authentication with the third-party provider. The following example shows Microsoft Authenticator and passwordstate.

In a real situation some of these screens would normally show user details such as email addresses or phone numbers. The following example shows generic screens.

  1. Anytime you try to login you are presented with MFA option to verify your identity.

  2. Select “I can’t use my Microsoft Authenticator app right now”.

  3. On the Add a method screen, select a Authenticator app as the new method.

  4. Select “I want to use a different authenticator app”.

  5. The Authenticator app presents you with a QR code. Scan the code the app for your chosen third-party authentication code service (passwordstate or cyberark).

  6. Enter the code that the app gives you in the One-Time Password Authenticator details.

Logging in with the One-Time Password Code

The OTP code generated by your chosen third-party authentication code service (passwordstate or cyberark) can be fetched using a REST API call triggered from your test script. The response will contain the code which can be used to complete the authentication process in the test designer script.

  1. Login to your security portal and remove your current device.

  2. Login using the OTP.

  3. Successful login.

  4. You may need to verify the account, but only the at the first login. Subsequent logins should not require account confirmation.

Getting a Password

To get a password, you must make an API call that can be executed from a JS script.

# Configuration

API_URL="https://client-passwords.appvance.net/api/onetimepassword/<item>"
API_KEY="API_KEY"

# Make API request using curl

curl -s -H "APIKey: $API_KEY" "$API_URL"

Appvance will create a passwordstate for clients which will have a different URL. Contact Appvance Support to have Appvance whitelist your IP adress and setup an OTP in passwordstate.


Last updated: September 05, 2023

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

Create Multiple Orders and Write Order IDs to a Repository CSV

Use this article when a Scenario Editor test needs to create multiple records and persist generated order IDs to a repository CSV for later validation or reuse.

Validation workflow

  1. Create the order records and capture each generated order ID from the response, UI, or service output.
  2. Write only the required fields to the repository CSV with a clear header and deterministic file path.
  3. Replay the consuming scenario and confirm it reads the expected rows without duplicate or stale IDs.

Last updated: September 30, 2026

Read and Write Data from a Downloaded XLSX File

Attaching the script along with the Screenshot to follow the steps

We need 3 different Service suite scripts

Test Script

Sample Script: WriteExcel.ds

Write JS

Write JS: Here as well, we need to define the repository name and file path after making the write action, We also need to add the controller URL and AIQ username
and Password

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function writeexcel(row, col, value)
{
var $excel= readExcel(filepathval);
var $sheetname = locker.get("sheet");
log($sheetname);
//var $sheetname="Sheet1";
var $sheet = $excel.getWorkbook().getSheet($sheetname); // Get sheet as an object HSSFSheet
  $excel.getWorkbook().setActiveSheet($excel.getWorkbook().getSheetIndex($sheetname));//Change active sheet to the one specified
  var $headers = $sheet.getRow(0);
  var $lastExistingColumn = $headers.getLastCellNum(); // Get number of colum
  locker.put("columnlength",$lastExistingColumn);
        log($excel);
        $excel.setValueAt(row, col, value);
        writeExcel($excel,  filepathval);
}
var filepathval=locker.get("filenameval");
var rowval=locker.get("rownum");
var colval=locker.get("colnum");
var actualval=locker.get("excelval");

log("servicesuite "+filepathval);
writeexcel(rowval,colval,actualval);

var $boundary = "--AIQ-DS-BOUNDARY";
var $repositoryName = "Appvance"; // CHANGE FOR YOUR REPO NAME, THIS CONF MUST BE IN THE USER ACCOUNT USED TO LOGIN
var $CONTROLLER = "http://localhost:8080"; // Controller URL
var $username = "appvance"; // username used to login to aiq
var $password = "appvance"; // password used to login to aiq
var $uploadPath = "Customer/VWR/ReadWriteXLS/"; // CHANGE FOR folder in repo where the modified file should be uploaded
include("{ds}/commonFunctions.js");

if (login($CONTROLLER)) {
    uploadFile(fileName, fileName);
    var $resp= get($CONTROLLER+"/AppvanceServer/rest/admin/logout");
    log("logout: "+$resp.getDataString());
};

Write JS. At step 26 and 30, make sure to add the repository name and the repository path, respectively, which the user cloned in the AIQ

 

Filename JS

Filename JS:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function columnlen(filepathvalcol)
{
  //var filepathvalcol=locker.get("filenameval");
  var $sheetname = locker.get("sheet");
  log($sheetname);
  log("reading excel from "+filepathvalcol);
  var $excel= readExcel(filepathvalcol);
  //var $sheetname="Sheet1";
  var $sheet = $excel.getWorkbook().getSheet($sheetname); // Get sheet as an object HSSFSheet
  $excel.getWorkbook().setActiveSheet($excel.getWorkbook().getSheetIndex($sheetname));//Change active sheet to the one specified
  var $headers = $sheet.getRow(0);
  
  var $lastExistingColumn = $headers.getLastCellNum(); // Get number of colum
  locker.put("columnlength",$lastExistingColumn);
  var headersArray = []
  for (var col = 0; col < $lastExistingColumn; col++) {
    var cell = $headers.getCell(col);
     switch (cell.getCellType().toString()) {
        case "STRING":
           headersArray.push(cell.getStringCellValue());
           break;
        case "NUMERIC":
           headersArray.push(cell.getNumericCellValue());
           break;
        default:
           headersArray.push(cell.toString());
           break;
     } 
  }
  locker.put("headers", headersArray);
}


var json = locker.get("fileDownloadedList");

// [{"path":"C:\Users\Administrator\TestDesigner\NetworkProxy\execution\Chrome10383680D\EnrollmentSearch_2024022217255349.xls","name":"EnrollmentSearch_2024022217255349.xls","length":4702}] 

var filePath = ""+json.getJSONObject(0).getString("path");
var fileName1 = ""+json.getJSONObject(0).getString("name");
var fileName = fileName1.replace(/\s+/g, '_')
locker.put("repofilename",fileName);
locker.put("filenameval",fileName);
filePath = filePath.replace(/\\/g,"/");
// path to your repo
var pathToYourRepo = "REPOSITORY/Appvance/Customer/VWR/ReadWriteXLS/" + fileName; // Give the path pointing to the folder that has the script
log("servicefilename val "+pathToYourRepo);
locker.put("pathToYourRepoval",pathToYourRepo);
log("file saved at: " + pathToYourRepo);
var fileContentAsBytes = java.nio.file.Files.readAllBytes(java.nio.file.Paths.get(filePath));

writeBytes(fileName, fileContentAsBytes);

log(" | downloaded file size: "+fileContentAsBytes.length);

columnlen(fileName);

HEADING

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function uploadFile(fileName, filePath) {
        var data = createMultipartPayload(fileName, filePath);
    var call = createPost($CONTROLLER + "/AppvanceServer/rest/file/uploadFile?&commitMessage=Appvance+skip+commit&path=REPOSITORY/" + $repositoryName + "/" + $uploadPath + fileName, data, "multipart/form-data", " boundary=" + $boundary);
    var resp = process(call);
    log(resp.getDataString())
}


function getSessionCookie() {
    var $jsession = getCookieValue($CONTROLLER, "JSESSIONID");
    var cookie = "JSESSION=" + $jsession;
    locker.put("aiq-cookie", cookie);
    addGlobalHeader("cookie", "JSESSION=" + $jsession);
}

function login() {
    var $loginForm = formData();
    $loginForm.put("username", $username);
    $loginForm.put("password", $password);
    var $resp = get($CONTROLLER+"/AppvanceServer/rest/admin/isLogged");
    if ($resp.getDataString().indexOf("false")) {
        var $call = createPost($CONTROLLER + "/AppvanceServer/rest/admin/logginForServices", $loginForm);
        var $resp = process($call).getDataString();
        if ($resp.indexOf("true") != -1) {
            getSessionCookie();
            log("Login successful");
            return true;
        } else {
            log("Login was NOT successful: " + $resp)
            return false;
        }
    } else {
        getSessionCookie();
    }
    
}

function createMultipartPayload(filename, path) {
    var header = '--' + $boundary + '\n' +
        'Content-Disposition: form-data; name="file"; filename="' + filename + '"\r\n' +
        'Content-Type: application/octet-stream\r\n\r\n';
    var headerBytes = new Array(header.length);
    for (var i = 0; i < header.length; ++i) {
        headerBytes[i] = header.charCodeAt(i);
    }
    var $data = readBytes(path);
    var footer = '\r\n--' + $boundary + "--\r\n";
    var footerBytes = new Array(footer.length);
    for (var i = 0; i < footer.length; ++i) {
        footerBytes[i] = footer.charCodeAt(i);
    }
    return headerBytes.concat($data).concat(footerBytes);
}

function getLastDownloadedFile(json) {
    json.sort((a, b) => b.modifiedTime - a.modifiedTime);
    return json[0];
}

Last updated: December 20, 2024

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