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
- Automating Multi-Factor Authentication in Scenario Editor
- Browser Versions for Scenario Editor Testing
- Automate Scrolling in Scenario Editor
- Find the Position of an HTML Element in Scenario Editor
- Add Snapshot Evidence in Scenario Editor
- How to access and extract the content of the table
- How can I wait for an object to disappear?
- Return the Current Date in a Specified Format
- EnterKey Event in Sahi.
- Designer: file:// Protocol Support
- Date Functions and Formatting
- Shadow DOM Settings for Scenario Editor Tests
- Grant Microphone Permissions for Scenario Editor Tests
- Capture the Current Application URL in Scenario Editor
- How to get all values of dropdown
- How to get hidden elements from DOM?
- How to Generate a Random Number Within a Given Range
- Format Dates for Scenario Editor Tests
- How to Data-Drive Xpaths
- Find Rows by Visual State in Scenario Editor
- Extract Numbers from a String in Scenario Editor
- Check Whether a Scrollbar Has Reached the Bottom
- Generate a Three-Digit Random Number in Scenario Editor
- Create Unique Strings in Scenario Editor Scripts
- Call JavaScript Functions from Scenario Editor
- Data-Drive Wait Values in Scenario Editor
- Validate Scrolling Reaches the Bottom of a Page
- Generate a Three-Digit Random Number in Scenario Editor
- Close Browser Windows in Scenario Editor
- Manage Multiple DPL Data Sources in Scenario Editor
- How to handle pop-ups in a website using designer?
- Validate Toast Messages in Scenario Editor
- Parameterize File Uploads in Scenario Editor
- Read and Write CSV Rows for Scenario Editor Data
- Normalize Extra Spaces in Scenario Editor Values
- Retrieve Page Elements in Scenario Editor
- Retrieve Numeric Values from Text
- Extract Text Between Delimiters in Scenario Editor
- Legacy Sahi Logging Guidance
- Trim Text Values in Scenario Editor
- Use Custom JavaScript Helpers in Scenario Editor
- Validate Video Playback in Scenario Editor
- Verify Checkbox Checked and Unchecked States
- How to verify Sorting Functionality
- Verify Disabled Buttons in Scenario Editor
- Include functionality in Appvance Designer
- Latency in AssertExists.
- Log Specific Errors During Scenario Execution
- Pagination - How to search items in a page with multiple paginations
- Self-Healing Questions for Scenario Editor
- Regular Expression in Appvance Designer.
- Solutions to common Test Designer IDE Challenges
- Group Step Statistics at a Higher Summary Level
- Test Designer 3: HTML5 and Web Application Compatibility
- Use Relative File Paths for Scenario Editor Uploads
- Use Looping Patterns Safely in Scenario Editor
- Using writeCSVFile API in Sahi.
- Working Around Asynchronous Popups
- Which JavaScript version is supported?
- Browsers Not Listed When Clicking Record
- Handle Browser Location Permission Prompts
- Validate Downloaded Files in Scenario Editor
- Self-Healing Support in Scenario Editor
- Authentication Mechanisms in AIQ Tests
- Handle Validation Failures and Continue Scenario Execution
- How can use a wild card when part of the identifier is always changing?
- SmartTags: Using a custom getName Method
- Maximizing the number of concurrent browsers
- Understand Step Duration Calculations in Scenario Editor
- Troubleshoot Iteration Summary Error Messages
- Capture and Validate Tooltips in Scenario Editor
- How to access two different application at the same time in a single script.
- How to find the X Y Coordinates
- How to perform Mouse Over action using Toggle Style API From Test Designer
- Verify Whether a User Exists in the Database
- Validate Color of an Object
- MFA Authentication Automation Guidance
- Create Multiple Orders and Write Order IDs to a Repository CSV
- Read and Write Data from a Downloaded XLSX File
Legacy Test Designer 2.0 and 3.0 Reference
Contents
- Automating Multi-Factor Authentication
- Browser Versions
- How to automate the Scroll bar?
- How to find the position of an html element?
- How to add Snapshot step in a designer script 2.0?
- How to access and extract the content of the table
- How can I wait for an object to disappear?
- Function to return date in any required format.
- EnterKey Event in Sahi.
- Designer : File:// protocol support in Designer
- Date Functions and Formatting
- About Shadow DOM Settings
- Granting Microphone Permissions
- How to get the application URL?
- How to get all values of dropdown
- How to get hidden elements from DOM?
- How to generate a random number within a given range?
- How to fetch specific date format?
- How to data drive Xpaths
- How to Fetch a row which has a particular Style?
- How to extract Only Number and "." from a string?
- How to check Scrollbar is reached to the bottom
- How to enter 3 digit random number in DS/JS script
- How to create a unique string for use in designer script?
- How to call a JS function from Test Designer IDE
- How to data drive a wait statement?
- How to check Browser Scrollbar is reached to the bottom
- How to escape special characters in Designer
- Closing a window
- How to handle Multiple DPL files in Test Designer IDE
- How to handle pop-ups in a website using designer?
- How to hold and free toast message
- How to parameterize files for the file upload feature?
- How to Read and Write multiple rows from the CSV file?
- How to remove all extra spacing between words?
- How to retrieve all the elements on a page
- How to retrieve the only number from a string?
- How to retrieve value between 2 characters?
- How to stop the Sahi logging feature in Appvance IQ.
- How to trim a string value from a string?
- How to use custom functions from JS file in Test Designer
- How to Validate whether the video is played back?
- How to verify checkbox is checked/unchecked ?
- How to verify Sorting Functionality
- How to verify the disabled button?
- Include functionality in Appvance Designer
- Latency in AssertExists.
- Logging Specific Errors
- Pagination - How to search items in a page with multiple paginations
- Questions of Self-Healing in Test Designer
- Regular Expression in Appvance Designer.
- Solutions to common Test Designer IDE Challenges
- Statistics at a higher summary level for grouping steps
- Test Designer 3: HTML5 Support
- To reload a page from a script
- Using setFile in Test Designer with Relative Paths
- Using while loop in Test Designer 2.0
- Using writeCSVFile API in Sahi.
- Working Around Asynchronous Popups
- Which JavaScript version is supported?
- Clicking on Record, do not see the browsers listed.
- Handling the Location Permission Browser Popup
- How to get the downloaded files in test designer?
- Which Accessors can be self-healed?
- Authentication Mechanism in Appvance
- How can I validate and handle a failure in my app so my script can continue?
- How can use a wild card when part of the identifier is always changing?
- SmartTags: Using a custom getName Method
- Register any email with Google Drive
- Maximizing the number of concurrent browsers
- How are step time durations calculated in Test Designer
- Iteration Summary Error Message
- How to capture and validate tooltips using Test Designer
- How to access two different application at the same time in a single script.
- How to find the X Y Coordinates
- How to perform Mouse Over action using Toggle Style API From Test Designer
- How to verify a particular user is available in the database or not?
- Validate Color of an Object
- MFA Authentication Automation
- Creating Multiple Orders and Writing the Order IDs into a CSV File on the Repository
- Read and Write Data from a Downloaded XLSX File
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.
-
Anytime you try to login you are presented with MFA option to verify your identity.
-
Select “I can’t use my Microsoft Authenticator app right now”.
-
On the Add a method screen, select an Authenticator app as the new method.
-
Select “I want to use a different authenticator app”.
-
The Authenticator app presents you with a QR code. Scan the code the app for passwordstate .
-
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.
-
Login to your security portal and remove your current device.
-
Login using the OTP.
-
Successful login.
-
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
Recommended guidance
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
- A scenario fails after Chrome, Firefox, Edge, or the operating system updates.
- Playback works on one Test Node but fails on another.
- Selectors, downloads, popups, certificates, or permissions behave differently between runs.
- Headless and headed execution produce different results.
Recommended checks
- Record the browser name, browser version, Test Node, operating system, and AIQ build used for the run.
- Confirm the browser is supported by the current AIQ release and the selected execution mode.
- Check enterprise-managed browser policies before changing browser settings.
- Reproduce with a controlled browser version when troubleshooting regressions.
- 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
Recommended guidance
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
- Verifying that an element is visible inside a viewport or container.
- Checking scroll behavior, drag targets, or visual placement.
- Troubleshooting why a click or gesture hits the wrong area.
- Comparing responsive layouts across browsers or screen sizes.
Validation checklist
- Confirm the element is present, visible, and not covered by another element.
- Record browser, viewport, zoom, device scale, and Test Node details.
- Use waits so layout has stabilized before reading position.
- 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
- Before and after a critical action.
- At the first meaningful failure point.
- When validating layout, displayed data, or a confirmation page.
- When troubleshooting intermittent behavior across browsers or Test Nodes.
Good practices
- Name the step clearly so the snapshot is easy to find in output.
- Capture only useful checkpoints; too many snapshots make analysis noisy.
- Keep sensitive customer data out of screenshots when possible.
- 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
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.
getDate()returns the day of the month.getMonth()returns the month as a zero-based value (0for January through11for December).getFullYear()returns the four-digit year.- The month number is used to retrieve the corresponding abbreviated month name from the
monthNamesarray. - A leading zero is added to the day when necessary.
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, add1when 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.
- Start a web server that serves the directory containing your HTML pages.
- Open the page using its HTTP or HTTPS URL, for example:
http://localhost:8080/index.html - Open the page in Designer using the web server URL.
- 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.htmlis 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
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:
-
forcedShadowDominglobal.jsonis set totrue -
Set ShadowDOMaction is not specified in test script
Expected behavior:
-
AIQ should find the Shadow DOM elements and the script execution completes successfully.
Example 2
Settings:
-
forcedShadoDominglobal.jsonis set totrue -
Set ShadowDOMaction in the test script is set tofalse
Expected behavior:
-
AIQ should find the Shadow DOM elements and the script execution completes successfully. This is because even though the individual script setting is
false, the setting in theglobal.jsonfile is given priority.
Example 3
Settings:
-
forcedShadowDominglobal.jsonis set totrue -
Set ShadowDOMaction in the test script is set totrue
Expected behavior:
-
AIQ should find the Shadow DOM elements and the script execution completes successfully. This is because the Shadow DOM property is set to
truein both locations.
Example 4
Settings:
-
forcedShadowDominglobal.jsonis set tofalse -
Set ShadowDOMaction is not specified in test script
Expected behavior:
-
AIQ will not locate the Shadow DOM elements and the script fails.
Example 5
Settings:
-
forcedShadowDominglobal.jsonis set tofalse -
Set ShadowDOMaction in the test script is set tofalse
Expected behavior:
-
AIQ will not locate the Shadow DOM elements and the script fails.
Example 6
Settings:
-
forcedShadowDominglobal.jsonis set tofalse -
Set ShadowDOMaction in the test script is set totrue
Expected behavior:
-
AIQ should find the Shadow DOM elements and the script execution completes successfully.
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
- Confirm the test environment is approved to use microphone access and does not capture sensitive audio.
- Preconfigure the browser profile or test policy so the permission behavior is deterministic.
- 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")
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
How to get hidden elements from DOM?
Steps:
- Open the application in the chrome browser
- Inspect the element
- Go to the console tab
- 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); - 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:
Evaluate DPL:
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)")
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, '')
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:
- Retrieves the total height of the target scrollbar using
scrollHeight. - Retrieves the current vertical scroll position using
scrollTop. - Retrieves the visible height of the scrollbar using
clientHeight. - Calculates the remaining scrollable height.
- Checks whether the specified cell is visible using
isVisible(cell(VARIABLE)). - If the cell is visible, the function stops.
- 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.
Recommended approach
- Generate values from 100 through 999 when a true three-digit number is required.
- Use a DPL or approved helper when the value must be reused across steps.
- Store the generated value if later validation needs to compare it.
- Avoid using random values for data that must be repeatable for troubleshooting.
Validation workflow
- Generate the number before the input step.
- Enter it into the target field.
- Validate that the application saved or displayed the same value.
- 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
- Choose the uniqueness strategy based on the system under test and cleanup requirements.
- Store the generated value if later steps need to reuse it for validation.
- 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
- Add the JavaScript file with Include before calling the function.
- Call the function with customJS and pass parameters from DPL, constants, or captured variables.
- 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
- Different workflows have documented processing windows.
- External systems return at different approved polling intervals.
- The timing value is part of the test data model and needs traceability.
Good practices
- Store timing values in an approved DPL or test data source.
- Use clear field names such as waitTimeoutSeconds or pollingIntervalSeconds.
- Set maximum limits so bad data does not create excessive waits.
- 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.
Recommended checks
- Validate a stable element that appears only near the bottom.
- Check that lazy-loaded content has finished loading before continuing.
- Use a container-specific check if the page has multiple scrollable areas.
- Avoid assuming that one scroll action always reaches the bottom on every viewport.
Validation workflow
- Scroll toward the target area.
- Wait for the expected bottom marker, footer, or final item.
- Assert that the expected element or content is visible.
- 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:
We can "\" to escape the special character and run the script successfully.
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.
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
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.
Here is the script attached for the above mentioned example
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
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.
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);
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.
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.
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
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
Logs from DS3
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 "*"
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.
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)
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
- 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
This function will calculate a 10% discount on a Price that is entered. The usage of function in TD script is shown below
2. We can also make use of the Custom JS action in DS and then fetch the value using the locker
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.
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
- Inspect whether the checkbox is native HTML or a custom UI control.
- Validate the correct state attribute or property for checked/unchecked behavior.
- 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
- The script determines the number of rows in the table.
- It retrieves the values from the target column and stores them in an array.
- Each value is compared with the following value.
- 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 + 2increment 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:
Use the below code to verify disabled:
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
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
- Decide which error condition needs explicit logging and where it occurs in the scenario.
- Log the minimum useful context: step name, data row, expected value, actual value, and relevant output.
- 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.
The code will search for the string in the page if the string is not found then it will click on the next pagination
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
-
Could we have a list of what actions are included in self-healing, please?
-
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?
-
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.
-
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:
-
findElsByJqStr
-
focus
-
blur
-
expand
-
doSearch
-
collapse
-
formSubmit
-
pointerOut
-
pointerOver
-
pointerEnter
-
pointerLeave
-
pointerDown
-
pointerUp
-
click
-
click2
-
clickIfFound
-
rightClick
-
mouseOver
-
mouseMove
-
mouseDown
-
mouseUp
-
drop
-
drag
-
nativeDrag
-
nativeDrop
-
clickXY
-
mouseOverXY
-
mouseMoveXY
-
mouseDownXY
-
mouseUpXY
-
mouseDrag
-
mouseDrop
-
doubleCkick
-
doubleClickXY
-
toggleStyle
-
setCaretPosition
-
sentEnter
-
sentText
-
selectText
-
clearText
-
sendKeys
-
setValue
-
setText
-
setValuetoEditor
-
setSelected
-
setChecked
-
reOrderListForVue
-
break
-
paste
-
assertContrainsText
-
assertDoesNotContainText
-
waitUntilVideoCompleted
-
keyboardCommand
-
setHTML
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.
cell("AddImage/Attachment for Issue # 40")
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 |
Links to other common challenges:
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:
- Basic Authentication
- NTLM Authentication
- Cookie-Based Authentication
- Digest Authentication
- ADFS with Kerberos Authentication
- Active Directory Authentication
- ADFS with NTLM Authentication when ADFS Extended Protection token checking is disabled
- ADFS with Negotiate Authentication when ADFS Extended Protection token checking is enabled
AIQ Authentication
Authentication to the AIQ application itself can be configured using:
- Internal AIQ credentials
- LDAP authentication, which requires additional configuration
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:
- React
- AngularJS
- Angular
- jQuery
- ExtJS
- Bootstrap
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:
- Browser version
- Framework version
- Application architecture
- Custom JavaScript event handling
- Custom web components
- Security and certificate policies
- Third-party browser extensions
- Application-specific DOM behavior
- Framework-specific event handling
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:
- setFile in designer should have the path "Images/photo.JPG" as seen in the below screen shot.
Scenario Builder:
- Create the scenario by browsing the designer script created.
- Go to Resources and select the Images folder as seen below.
- Save and play the scenario!
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.
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
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.
- Open the
configfolder in your local Test Designer installation:TestDesigner/NetworkProxy/config - Locate and open the
global.jsonfile. - Find the browser and platform that are experiencing the issue.
- Verify that the configured browser executable path matches the actual location of the browser executable on your system.
- 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:
- Close Test Designer.
- Restart Test Designer using Run as administrator.
- 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.
- 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.
- Restart Test Designer as Admin.
Handle Browser Location Permission Prompts
How to achieve or handle location permission pop-ups in AIQ.
-
Stop test designer
-
Navigate to "\TestDesigner\NetworkProxy\config\Chrome" in your installation.
-
Take backup of the "AllowDownloads.json" file by renaming it.
-
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"
}
}
} -
Start test designer
-
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.
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:
-
assertContrainsText
-
assertDoesNotContainText
-
blur
-
break
-
clearText
-
click
-
click2
-
clickIfFound
-
clickXY
-
collapse
-
doSearch
-
doubleCkick
-
doubleClickXY
-
drag
-
drop
-
expand
-
findElsByJqStr
-
focus
-
formSubmit
-
keyboardCommand
-
mouseDown
-
mouseDownXY
-
mouseDrag
-
mouseDrop
-
mouseMove
-
mouseMoveXY
-
mouseOver
-
mouseOverXY
-
mouseUp
-
mouseUpXY
-
nativeDrag
-
nativeDrop
-
paste
-
pointerDown
-
pointerEnter
-
pointerLeave
-
pointerOut
-
pointerOver
-
pointerUp
-
reOrderListForVue
-
rightClick
-
selectText
-
sendKeys
-
sentEnter
-
sentText
-
setCaretPosition
-
setChecked
-
setHTML
-
setSelected
-
setText
-
setValue
-
setValuetoEditor
-
toggleStyle
-
waitUntilVideoCompleted
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
Recommended guidance
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
- UI login through Scenario Editor when the login flow is part of the test objective.
- Service Suite authentication for API tokens, OAuth flows, or setup calls.
- Pre-created test accounts with known permissions and reset procedures.
- Session setup or teardown steps that keep each run independent.
Best practices
- Use dedicated test accounts instead of personal or production accounts.
- Store secrets in approved secure locations, not in visible steps or shared notes.
- Validate multi-factor, SSO, captcha, or conditional-access requirements before automation.
- Clear sessions when tests must start from a known state.
- 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
-
Check if something is visible
-
If it is visible, then proceed with workaround step(s)
-
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?
-
As a user, you would like to check for the existence of an issue…
-
But before sending the result back (where the script or AISG will continue running)
-
You would like to recover from the issue and work around it if possible.
-
This means you
-
First check for the existence of the issue,
-
And if it exists, handle the issue,
-
And only then after it’s handled, return the failure status back to the script.
-
-
If the assertion were first,
-
Then the subsequent steps would be skipped, as a failure result would occur,
-
And the remaining steps would be skipped.
-
Steps
Option A: Example Using SmartTag Validations
-
SmartTag validations are triggered either pre- or post- interacting with associated SmartTag(s)
-
In this example, after an action against the svBtnAddToList SmartTag, the failIfValidEffectiveDateMsgExistsAndHandle validation triggers
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.
-
JavaScript
click(svBtnAddToList('Add To List')); -
Test Designer IDE
-
AISG
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:
-
JavaScript
validate(“verifyDobAutoYearUpdate”); -
Test Designer IDE
-
AISG
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
Given a link generated as link("http://test.someurl.com/abc123")
Where abc123 matches the a unique resource ID
The Fuzzy Logic syntax would be link(["http://test.someurl.com/"])
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.
Related Topics
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:
m6id.2xlarge: 8 vCPUs, 32 GiB memory, 474 GB NVMe SSDm6id.4xlarge: 16 vCPUs, 64 GiB memory, 950 GB NVMe SSD
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 recommended setup uses an initialization script, such as nvme_setup.sh, to prepare the performance node.
The script should:
- Detect and mount the available NVMe instance-store device.
- Copy the GraalVM installation to the NVMe storage.
- Copy the
aiq_distributiondirectory to the NVMe storage. - Configure Chrome to use a local cache directory on the NVMe storage.
- 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 |
|---|---|
| 40 |
| 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:
- Application complexity
- Number and type of requests generated by each browser
- JavaScript execution
- Browser memory consumption
- CPU utilization
- Network traffic
- Test data
- AIQ configuration
- Chrome version
- Operating-system configuration
- Storage performance
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:
- CPU utilization
- Memory utilization
- EBS IOPS and throughput
- NVMe utilization
- Disk latency
- Network utilization
- Number of open files
- Number of running processes
- Chrome memory consumption
- 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.
-
Dom Complete (current default mode)
-
Server Response Complete
-
Full Page Loaded
The following timings are calculated by the Test Designer engine:
-
Next Step Ready
-
Ajax Time
-
Script Time (usually closer to human perceived duration)
Each of these options are detailed below.
Timings provided by the Browser (Performance Navigation Timing standard)
You can calculate timings by:
-
Opening a Chrome browser outside AIQ in incognito mode.
-
Right-click and click inspect in the browser context menu.
-
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
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
- Identify whether the tooltip appears on hover, focus, or click and whether it is native or custom HTML.
- Capture the tooltip text or attribute after the UI has displayed it.
- 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.
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);
- Just copy and paste the above code into the browser’s console and press the ‘Enter’ key.
- 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
- Mouse Over
- Toggle Style
MouseOver using Toggle Style Action
Add the below step with the accessor which needs to be Mouse over
- Select API as Toggle Style from the scripts step
- Add the Accessor which needs to mouse over
- Add “hover“ in the value column
Example Screenshot
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:
-
Need a SQL file to retrieve the data from the database
-
Need a service suite script to run the SQL query and store it in a variable to compare
-
Need a CSV file that contains the user or users
-
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.
-
Anytime you try to login you are presented with MFA option to verify your identity.
-
Select “I can’t use my Microsoft Authenticator app right now”.
-
On the Add a method screen, select a Authenticator app as the new method.
-
Select “I want to use a different authenticator app”.
-
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).
-
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.
-
Login to your security portal and remove your current device.
-
Login using the OTP.
-
Successful login.
-
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
- Create the order records and capture each generated order ID from the response, UI, or service output.
- Write only the required fields to the repository CSV with a clear header and deterministic file path.
- 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
-
A common JS script
-
Filename JS: Where we are providing the Sheet name, Path of the repository where the file is being saved
-
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
Test Script
Sample Script: WriteExcel.ds
-
Testfile name: At step number 45, make sure to add the repository path and the repository name which the user cloned in the AIQ
-
After clicking on download, add a step store in locker and provide the sheet name, which is there in the download file
-
In Ds script at step 55 and 61, make sure to give the exact header name for the targetted column header
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