2.2 - Web Testing

Web Testing — Appvance IQ documentation.

Web Testing with AIQ

Contents

AIQ provides functional, load & performance, and security testing for web apps and websites.

AIQ enables you to test websites and web apps, from UI to API, as part of your continuous testing program. Launch a complete set of functional tests (integration, smoke, and regression tests) as well as performance and app pen tests using the same test assets developed in any of AIQ’s test creation modules—AISG, Test Designer, Automatic Regression Testing, and Services Workbench.

Leverage the most complete solution for guaranteed quality. Move fast, release confidently.

AIQ enables you to meet all your end-to-end web testing needs whether you need functional, integration, performance, load, or security testing capabilities. Test cross-browser compatibility easily in multi-browser execution scenarios or test website appearance on mobile platforms.

Support use cases like uploading files, validating CSS, testing drag & drop actions, or an array of other complex functions. You can even use scripts you may have written in other languages or frameworks, for maximum flexibility.

Capture self-healing tests for use with advanced, complex, modern web technologies using AIQ’s codeless Web Test Designer. Test your sites with AI-generated tests via the exploratory AISG or Automatic Regression tests. Employ both UX and API testing and timings. Reproduce issues for easy resolution using our Instant Replay technology. Get accurate results with implicit wait times built in.

Run tests that reflect the way your users behave.

AIQ supports dynamic web apps and sites, assuring reliability and effectiveness so you can keep your business secure. Data-driven testing validates your key transactional processes.

Currently, there are two web testing interfaces:


Last updated: April 12, 2024

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

Web Designer

There are major changes and enhancements to the user interface for creating, maintaining and executing web tests in the 5.0.0 release of AIQ.

This document is meant as a quick start guide to help acquaint you with the new Web Designer and explain the basic components in the interface.

You can watch a video introducing you to the features and benefits of the new Web Designer.

Here is a comparison between the Web Testing menu options in AIQ 5.0 and previous AIQ releases.

AIQ 5.0.0

AIQ 4.10.x (and older)

7dZMk1QDS6b1CN7p-7aca16411fdc.png

6sgIS5TCNqJ6bblh-155dd342d8a1.png

See Web Testing User Interface Overview for an explanation of the differences between the new and classic interfaces.

For your convenience, the information about the new Web Designer interface is included in the AIQ 5.0.0 Release Summary. This document also contains the AIQ 5.0.0 Release Notes, which includes information about the AIQ 5.0.0 release.


Last updated: September 17, 2024

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

Web Designer

This is the AIQ Web Designer.

image.png

Web Designer allows the user to:

  1. Record a script by interacting with the AUT
  2. Edit existing text created by AISG or GENI
  3. Run and edit existing scripts (for example, using the "Record From Here" option to add missing steps, or modify the script to accept new modules added to the AUT)

There are three main sections in the Web Designer:


Last updated: March 17, 2024

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

Use Instant Replay to Review Web Test Failures

How about Recording Network activity in the background while you are recording your UX test cases using Test Designer?

Test Designer Instant Replay is the answer. Yes, Test Designer Instant Replay can capture all your network activity while a use case is getting recorded in Test Designer and it can be exported as a .zip (with HAR and contents of the page), CSV file that has details of the method, port, vhost, uri, status and also as an executable JS fie.

API Testing Process:

When an API request is done, Test Designer tells the browser to do the request, but it injects a header to capture and provide the API calls.

With the option, Exclude requests matching the following regular expressions(comma separated): with default values of (.*\.(jpeg|png|gif|bmp|svg|css|js|gif|woff2|jpg).*), will filter out all those files with the mentioned extensions, you can remove or add or make any changes to these extensions depending on the requirements.

Navigation:

From the dashboard page, Under Record, Click Test Designer Instant Replay.

File Menu:

  1. Open: Only allows .zip files. When you save the file after having some traffic recorded, File > Saving will save the file with a .zip extension or when you do a File > Export to HAR, it will save with a .zip extension. File residing in the local machine can be opened using File > Open.

  2. Save: Is used to save the file after changes or a new unsaved file.

  3. Save As: Is used when you want to do a Save As of an already opened file with a different file name.

  4. Comparison Report: Two Instant replay zip files can be compared to check the differences between the Response body, Headers, Payloads.

    Typically used for the same type of flows, with different login details, or with different environments to check the differences between Response bodies, headers, or payloads.

  5. Export :

Comparison Reports

To generate the comparison report, you first need to load the open the instant replay file to compare against baseline data by making use of File > Open and open the zip file that is saved as the instant replay of the script.

Click File and choose Comparison Report from the Drop-down.

API Comparison pop-up would be displayed to choose the baseline data to file Instant Replay (.zip file) with the Browse button.

Maximum payload size (chars): would default to 4096 chars but that is something that can be changed and allows only numerical entries.

Start Comparison button would be enabled, clicking which will download a zip containing all the reports.

It is required to extract the downloaded zip content of the files and open the generated .html file.

Below is the comparison report that is going to be generated, which will show the comparison report file name, the files that are used for comparison, and the maximum data size.

It displays all the Requests along with the size, Response Body and the differences for each of the rows which can be expanded/collapsed, Headers and request/response header differences which can be expanded/collapses for each of the rows, Payload with differences for each of the rows which can be expanded/collapsed.

There is an option to hide or show the row numbers.

Also, the option to choose a particular column that needs to be displayed.

You can click each of the buttons like "response headers diff" for example to check the differences.

6. Export: The recorded traffic can be exported to 3 different formats.

a) HAR: downloaded as a .zip file, contains the har calls "Record.har" plus all the history containing .jpg's, .html's, txt's, .dat's, .json files etc

b) CSV: Contains details of the method, port, vhost, uri, status. This CSV can be used as a log from Appvance AI as well

c) JS: A executable JS Script with all the gets and posts like the one below

Actions Menu:

  1. Start Recording: will start recording HAR traffic for the app that will be recorded using Test Designer IDE.

  2. Re/Start Playback: will clear the historical data which is already present and make a fresh recording of the requirement for playback.

  3. Stop: will stop recording HAR traffic calls.

  4. Clear History: will simply clear your recording area and it will be ready to record new HAR traffic.

  5. Show calls: This is more like a refresh button, that keeps updating the new traffic that got recorded.

Status:

You will see Status on the top right corner of the page, Initially Status will be Standard.

When you click Start Recording from the Action menu bar Status will change to Record, and Again, Status will be Standard when you click Stop from the Action menu bar.

How to use Test Designer Instant Replay

Follow these steps:

  1. Go to Instant Replay and click Start Recording from the drop-down.

  2. Go back to Test Designer IDE and begin Recording by clicking Record > choose a browser and perform your UX actions.

  3. Come back to Instant Replay and click Show calls from the Action Menu, you will notice all the traffic that is getting captured.

  4. Once done with all the recording, you can go ahead and save the file as a .zip file or any other 2 formats mentioned above.

  5. Not just recording, Test Designer Instant Replay also records the history calls when we playback scripts from Test Designer.

  6. Go back to Test Designer IDE, open any existing script, come to Instant Replay, click 'Start Recording' and playback the script from Test Designer IDE, and you can click 'Show calls' from the Action menu, you will notice all the traffic that it got created.

  7. These traffic logs can be used to generate more traffic when running as a performance test (running at the protocol level) using along with the actual Test Designer script (running at the browser level).


Last updated: August 28, 2023

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

Edit and Play JavaScript Steps for Web Testing

JS Edit & Play is a tool within Test Designer that is completely JavaScript. Using this tool you can write custom code, add conditional statements, add loops, and create any complex scripts using JS Edit & Play like you would using IDEs such as Netbeans or Eclipse.

In JS Edit & Play, you can have can open multiple files which open in different tabs which makes it easy for the user to copy contents between different scripts.

JS Edit & Play also has IntelliSense, which is a code-completion aid. That means as you type, the default methods and functions along custom-defined variables and functions are available to select from the drop-down.

Note: Test Sesigner services must be running to work with JS Edit & Play.

Accessing JS Edit & Play

There are multiple ways to access JS Edit & Play.

Option 1

  1. Open the Test Designer IDE

  2. Open any existing Test Designer script or record a new script

  3. Click File > Export > JavaScript.

  4. Click Save to save the script. The script will have a .js extension.

  5. Click Play.

  6. The Test Designer JS Edit & Play window will open with the script opened. From here you can edit the script, add more JS steps, and perform other actions.

Option 2

  1. From AIQ navigate to Test Designer > JS Edit & Play.

  2. From here you can create a new script or open an existing script.

The following topics provide more information on the JS Edit & Play user interface and details and examples of working with scripts in the tool.

JS Edit & Play for Web Testing User Interface - Information about the following menus and functions:

Working with JS Edit & Play

<![CDATA[ ]]>


Last updated: July 25, 2023

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

SmartTag Workbench Reference

SmartTags are one of the unique features of Appvance IQ, SmartTags are collection of objects and their properties. This collection contains key-value pairs; the key being a logical name identifying the set of objects, and the value contains unique objects properties (ex: Valid HTML tags, SmartTag Type, Rules) that are used to identify the object on the web page.

One of the main burdens of an automated UI test script is the amount of maintenance needed when object properties change within the application under test. A very common way of minimizing the time it takes to update your automated test scripts is the use of a SmartTags Library. A basic SmartTag library can be implemented as a collection of key-value pairs, with the key being a logical name identifying the object and the value containing unique objects properties used to identify the object on a screen. This can be used in Test Designer scripting, JS scripting, and also during Appvance AI scans as Appvance AI supports creating application AISG using the SmartTag Library created.

For information on SmartTags for testing mobile applications, see SmartTag Workbench for Mobile Testing.

Accessing the SmartTag Workbench

In AIQ navigate to Web Testing > SmartTag Workbench.

SmartTag Summary Tab

The summary tab gives the summary of all defined SmartTags, actions, extractors, and validations.

SmartTag UI

The SmartTag Library tab allows you to create and configure SmartTags to be used for Test Designer or JS or Creating AISG more quickly. This is the place to edit your .json configuration files for the SmartTag library. The SmartTag Library tab allows to create, edit and delete SmartTags. This is a .json file. Will have .stags as the extension.

Creating a new SmartTag

To create a new SmartTag, simply fill all of the required input fields of the form and then click the "Add" button located at the top right of the container window. Make sure to fill up the following required inputs to be able to add a new SmartTag:

All the other inputs and data of the form are optional based on your needs, such as the rules, however, to create a new SmartTag you will always be required to provide the above input data. If you have selected a SmartTag from the "SmartTags List" selector and you want to create a new SmartTag, click the "SmartTags List" selector and select the first option called "Create New SmartTag", this will reset the SmartTags form and allow you to create a new SmartTag from scratch.

Manage Valid HTML Tags

The list of valid HTML tags is a static list of elements referenced from W3School's valid HTML tags list. However, if you need to add a custom HTML tag, you can do so by clicking the plus sign ("+") located beside the valid HTML tags selector label. This will prompt a modal window where you can type in the custom HTML tag to be added to the list of valid HTML tags of the current context.

You must follow the W3C Custom Elements standard for custom HTML tags such as hyphenation to add a valid HTML tag.

SmartTag Description

SmartTag descriptions can be used to provide meaningful descriptions for the SmartTags created that way it will help others in the team to check back on those descriptions to understand the SmartTags better.

Manage SmartTag Type

The SmartTag Type selector allows selecting the type of SmartTag you want to configure, based on the selected SmartTag Type, the available methods of the Methods and Actions table will toggle, each of the rule types have their own set of methods associated with. By default, when you are creating a new SmartTag or resetting the SmartTag form, the SmartTag type "Prop" will be selected. Once you have selected the desired SmartTag type, you can bind existing Actions to the available methods, all of the created actions so far in the current context will be available in the methods Action selectors at the Methods & Actions table at the bottom of the SmartTag container window.

Here's the list of methods linked to each of the available SmartTag types:

Manage SmartTag Rules

To add rules to your SmartTag, simply click the "Add Rule" button located under the "Rules" section, this will automatically add a new rule to the SmartTag, you will see the default rule type input fields displayed, these inputs will change depending on the rule type selected, meaning that based on the selected rule type you will be given a different kind of inputs and options to configure the SmartTag rule properly. Here's the list of available rule types and their corresponding input fields and restrictions:

To change a Rule Weight you can interact with the "Importance" slider of each rule container, the slider label will dynamically change based on the slider value so you can know exactly which is the rule weight.

To Remove a Rule simply click the "Remove" button located at the rightmost of the rule container.

Updating a SmartTag

File > Save and File > Save As can be used to save the modified changes.

To Remove a SmartTag, select a SmartTag from the "SmartTags List" selector and click the "Remove" button and click save.

SmartTags can be duplicated using the Duplicate button copying all the same contents and it will add a "SmartTagName-copy" and you can use the SmartTags to change or modify the SmartTags.

Actions Tab UI

Actions are used when you want to override the default behavior of a SmartTag.

For example, navigation's default action would be CLICK

if you need to change the default action, so if you need to click a specific area instead of a full click, a custom action could be created to perform this, and always remember to assign the action that was created in the Actions tab.

Actions tab allows you to create and configure Actions to the current context that can be bound with the SmartTag methods at the Methods & Actions table of the SmartTags Library tab.

You must use JQuery or JavaScript methods on the Action tab. Commands documented in Test Designer JS Commands Reference are not valid in the Actions Tab. However, those commands can be used in the Validations tab.

To create a new Action, type in the action name and the corresponding JavaScript function string and click the "Add" button located at the top right corner of the Actions tab container window. Make sure to fill up the following required inputs to be able to add a new action:

Once you have added the Action, it will be available at the Actions selectors of the Methods & Actions table of the SmartTag tab. If you have selected an Action from the "Actions List" and you need to create a new SmartTag, click the "Actions List" selector and select the "Create New Action" option, this will reset the Actions form and allow you to create a new Action.

/** You can create custom actions for SmartTags here.

*

*

**/

The array hint field is optional.

To update an Action is the same as the SmartTags Library tab functionality, you first have to select an Action from the "Actions List", modify the configuration as required, and then click the "Update" button.

To Remove an Action, select the action from the "Actions List" and then click the "Remove" button.

Example:

React Selects

Suppose there is a control that behaves like a Select, Drop-Down list, or Combo box but its HTML structure does not follow the standard, select, and option tags, but instead uses nested div tags. A Select type SmartTag allows the following interactions or functions: show values, get all values, get the selected value, and set value. Since the control does not follow the standard, the default implementation for the functions of Select type SmartTags will not work. Therefore, a custom implementation for each function must be provided.

Notice the getValue, getSelectValues and setSelected functions are bound to custom functions

Custom implementation for getValue which is set to use reactGetSelectValue

Post Actions & Previous Actions

Post Actions & Previous Actions selectors have linked with the "Actions List" selector, meaning that whenever you create or delete an action, this change will take place at all of the form selectors. These selectors allow you to bind multiple posts and previous actions to the current action in scope previous actions will be executed before the current action, and post actions will be executed after the current action.

JavaScript Function String

As the name suggests, a string representing a JavaScript function, this field is a JavaScript editor embedded in the UI that allows you to edit the JavaScript code professionally, providing coding tools such as code highlight, auto-close brackets, line numbers, and so on. It's important to notice that you must not include the function declaration, only the function body, this is part of Create AISG implementation under the hood, you must only code the JavaScript function body.

Note: All the SmartTags have getName which gets the accessors, we could override the getname so that the string that we get is not ambiguous for the Test Designer.

Extractors

Extractors are a type of validation that allows you to extract data from SmartTags.

The extraction process can occur before a SmartTag is processed or after a SmartTag is processed (Processing means the execution of the SmartTags)

You can extract many types of data, like the text of a SmartTag, the id of a SmartTag, various attributes of a SmartTag by providing the attribute name, you can also extract XPath's data by using xpath expressions.

Following are the ones that we could extract.

You can also provide customized JS code that allows you to extract many different elements from the whole page.

All the data that you extract are stored in a variable using the variable name.

As already mentioned there are pre and post actions:

An example of a pre-action could be a link where you need to get the text and store that value to be used for further processing or further validations.

Post Action extractors are something that you could store in a setValue, and after setting the value you could validate what was set as the input for those accessors using Post extractions.

You could also use JS code like the one below:

/**You can add JS code here.

**/

Examples of Pre-Action Extractor and a Post-Action Extractor below using Text:

Validations

Validations allow the extraction of data from a SmartTag and compare this data before or after a SmartTag is processed against a target that can be a variable from a previously executed Extractor or a valid JavaScript expression or a value.

Comparisons can be:

The importance of having a validator is that they have the flexibility of choosing different kinds of assertions compared to auto-validations before or after a SmartTag is executed.

As Extractors, you could choose the validators to be executed pre or post after a SmartTag is processed.

Different types of Validations are supported on:

Expected Value (JS Code): Expected string or the expected value to be entered.

Examples:

validating numbers - 257

validating text - "helloworld"

validating true/false - true or false values

We could also provide functions like - parseint(23)

parsestring("string").uppercase(); etc

Also, we could use the extractors to validate by invoking the defined extractors in the extractors tab just by using $ Symbol.

Hitting $ will invoke all the defined extractors from the extractors tab.

Some Examples Below:

Validation with Greater or Equal with Text Type and an Expected number value.

Validation with Contains Operator with Text Type and Expected string value.

This is an example showing invoking an Extractor using the $ symbol.

Other Validations

Other Validations allow determining the existence of a value or element after a SmartTag is processed. Before a SmartTag is processed, data is extracted from a SmartTag or the value of a previously executed Extractor or a specific JavaScript expression or value is loaded. After a SmartTag is processed, the value or the element is checked for its existence.

These validations always extract data from a SmartTag and after a SmartTag is processed, we validate the data against the resulting page or the specific element of the page.

The only assertion that we could do with other Validations is CONTAINS and DOES NOT CONTAIN.

This validation happens always after a SmartTag is processed.

Different Types supported:

Targets:

Some examples are below:

Type of Static Text and with expected text value targeting the whole page.

Type of Element Exist and provides the Locator value:

Note: The locator value is something that looks like the accessors from the Test Designer script.

Given this element: Login Button

<a id="login_link_id" name="login_name">Login</a>

Valid Locators can be:

link("/login")

link("Login")

link("login_name")

link(1)

Can also use CSS and XPath locators like:

byXPath('//*[text()="Login"]')

byCss("#taxonomies > div:nth-child(2) > a:nth-child(1)")

Native element types can be

link("")

textbox("")

emailbox("")

password("")

textarea("")

button("")

reset("")

span("")

submit("")

select("")

radio("")

checkbox("")

Type of Static Text expecting a string value from a Locator Target providing the Locator Value:

Type of Static Text expecting a string value (Extracted String value) from the whole page:

Note: When running designer scripts, you would notice that the validations would be performed both pre and post-validations.

Test Designer logs example:

Evaluating PreAction Validation: HasButtonNewLookUp for SmartTag: shopThisStore

Validation succeeds.

Validations have both pre and post-sections. Generally, pre section will always be successful and the post-section shall pass or fail depending on the assertion.

Pre section defines a variable with the value:

The post section performs the assertion based on the option selected in the Target field:

Settings

Settings are the most simple screen of the SmartTag UI, its purpose so far it's only to configure the SmartTag Rules Threshold, there's only a Slider control that allows you to change this threshold, by default it's 0.75. The range of this slider is from 0.0 to 1.0.

Files Management

The SmartTags UI allows you to handle SmartTags configuration files, these are JSON files (.json extension) that contain a valid SmartTags configuration JSON. The file manager window is available through the "File" drop-down located at the leftmost top corner.

These are the available options:

It is worth mentioning that the SmartTag UI will let you know when you have modified and opened the file and the changes have not been saved. When you open a file, the UI will display the file name right next to the "File" option of the file manager, if the file name label is in green color, it means that the file has not been modified since the last save (or not modified when opened), if the file name label is on orange color, it means that the file content has been modified but not yet persisted to disk, meaning that in-memory changes have not been saved to the file. To save the changes, use the "Save" option of the file manager.

SmartTag creation with an example application

In this section, we shall learn about the following:

Valid HTML Tags

SmartTag Types

Scan Types

SmartTag Rules

Navigate to SmartTag Workbench under Record and click File > New.

The first step is to fill up the SmartTag name, fill up the SmartTag name with meaningful names according to the usage, for example, Left_Menu_Items, Credentials, Top_Links are some valid names.

Valid HTML Tags

As we all know, everything you do on a web page is using tags. The basic format of a tag is this:

<TAG> (something) </TAG>

For example, say I want to get a header, like the one above. Well, the code for that header is:

<H1>Tags: What are they? How do they work?</H1>

Notice that the tag begins with: <H1> and ends with: </H1>. This is an important aspect of tags. Almost all begin AND end.

Some valid HTML tags are defined at: HTML Document Type

Valid HTML Tag selection depends on the element that we are looking at, To see tags on the web page, right-click the web page or the target element and select Inspect as shown below.

You could also notice a + icon next to Valid HTML Tags (+), it can be used to add any new custom HTML Tag Name to the default list from your application

SmartTag Types

A SmartTag can be of different types:

So depending on the element that you are looking for, a SmartTag Type should be chosen, for the example that we were working on, Navigation is the SmartTag Type that should be chosen (For the Home button) which navigates to a different page.

Scan Types

Scan Types are mostly used for scans that we perform in the AISG of the application creation.

Below are the 3 options available.

Once per app:

Check this option, If many navigation actions are redirecting to the same state, this option will consolidate them into just one for the entire site this strategy will reduce the scanning time and final file size as well.

Once per page:

Checking this option would make sense in cases such as a table containing details where all the SmartTags are mostly similar, AISG scan will process just the first occurrence by adding the action with the $SmartTag Name, this new capability will improve the AISG scan process and not repeating the same actions on that page.

Singleton:

This option is used for elements that only appear one time on the page.

SmartTag Rules

The available SmartTag rule types and short descriptive take some examples for each of the SmartTag rule types that are available so it is easy to understand.

For example, want to create a SmartTag for the "Next" button; select containsText and enter the text.

For example, to create a childTag as a rule for the below-highlighted element, use the rule as mentioned:

Try SmartTags in JavaScript/Test Designer

Now we know how to create SmartTag for different elements of the web page and other uses, now it is time to create some JS scripts using those SmartTags that we created.

For the application, http://demosite.appvance.com , we created 2 SmartTags for the products and the Shop by Brands left menu as highlighted below.

SmartTags created are shown below:

Useful AISG custom action examples

  1. GetName Custom Actions

    Get element text including the text of its children nodes.

    return ds$(element).text();

  2. Get only the current node element text.

    This action does return the current element node text without adding the text of its children nodes. If you apply this to a SmartTag that targets a span(“Yes“), this will make sure your SmartTag only focuses on the actual span that has the “Yes” text and not on its span’s parents.

    return ds$(element)
                    
    .clone() //clone the element
                    
    .children() //select all the children
                    
    .remove() //remove all the children
                    
    .end() //again go back to selected element
                    
    .text();
  3. Get the element name from one of the element’s attributes

    The following template can be used to set a general getName function that checks for an attribute to get its value, but if it does not have that attribute then it tries with another one. Modifying the code can change the order in which the attributes get fetched or add more attributes.

    var htmlElement = ds$(element);
                    
    var name = htmlElement.attr('id');
                    
    if (typeof name === 'undefined') {
                    
    name = "";
                    
    }
                    
    if (name === "") {
                    
    name = htmlElement.attr("value");
                    
    }
                    
    if (typeof name === 'undefined') {
                    
    name = "";
                    
    }
                    
    if (name === "") {
                    
    name = htmlElement.attr("name");
                    
    }
                    
    if (typeof name === 'undefined') {
                    
    name = "";
                    
    }
                    
    if (name === "") {
                    
    name = htmlElement.attr("placeholder");
                    
    }
                    
    if (typeof name === 'undefined') {
                    
    name = "";
                    
    }
                    
    if (name === "") {
                    
    name = htmlElement.attr("data-ref");
                    
    }
                    
    if (typeof name === 'undefined') {
                    
    name = "";
                    
    }
                    
    if (name === "") {
                    
    name = htmlElement.text();
                    
    }
                    
    if (typeof name === 'undefined') {
                    
    name = "";
                    
    }
                    
    return name.trim();
                    
  4. Set Value

    return ds$(element).val(params);

  5. Set Value and Enter

    return _ds.setValue(element, params + '{{ENTER}}');

  6. Do a fake MouseOver ( used for some menus)

    ds$(element).parent().find('div > ul').show();

    // where there is a div, and it has hidden child ul

  7. Get Element from a Custom Select ( For application based on complex frameworks)

    // This is an example using bootStrap

    // array hint should be defined as "array" (without quotation marks)

    var selectValues = [];

    ds$(element).find('a').each(function(idx, theElement){

    selectValues.push($(theElement).text().replace(/\n|\r/g, "").trim());

    });

    return selectValues;

  8. Set Select Element from a Custom Select ( For application based on complex frameworks)

    // This is an example using bootStrap
                    
    // array hint should be defined as "[]" (without quotation marks)
                    
    var found = false;
                    
    // params
                    
    ds$(element).find('a').each(function(idx, theElement){
                    
    var theElementText = ds$(theElement).text().replace(/\n|\r/g, "").trim();
                    
    if (params === theElementText && !found){
                    
    found = true;
                    
    //theElement.click(); // method 1
                    
    //ds$(theElement).click(); // method 2
                    
    // _ds.click(element); // method 3
                    
    }
                    
    });
                    
    return found;
                    
  9. Click to Show the list of elements inside a Custom Select (For applications based on complex frameworks)

    return ds$(element).click();

  10. Remove any new line character from the returned variable, in this case is "name"

    When creating SmartTag libraries, for the case of returning a name for SmartTags, please include this in the return ( if needed, otherwise please skip it):

    return name.trim().replace(/(\\r\\n|\\n|\\r)/g,\"\");
    var name = ds$(element).text();
                    
    if (name === ""){
                    
    if (ds$(element).hasAttr('data-component-id')){
                    
    name = ds$(element).attr('data-component-id');
                    
    }
                    
    if (ds$(element).hasAttr('id')){
                    
    name = ds$(element).attr('id');
                    
    }
                    
    }
                    
    if (typeof name !== 'string') {
                    
    name = "";
                    
    }
                    
    return name.trim().replace(/(\r\n|\n|\r)/g,"");

Last updated: March 18, 2024

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

Network Workbench Reference

Introduction

Network Workbench is similar to the AIQ Validation suite, but it is specific to Test Designer/JS Edit & Play.

Using Network Workbench, the requests can be extracted when it matches the URL which will be in a specific format like JSON, HTML, HTTP, MD5, PDF, etc., from the response to validate it or to create variables for future usage in the scripting.

The request has to be identified as a Regex that matches a fully qualified URL, Fully qualified means the protocol and port should be provided.

Example: Appvance.ai - AI-driven, unified test automation software - The fully-qualified URL is https://www.appvance.com:443

In any case, it is always better to use .* that will match any protocol, domain, and port.

Network Workbench will create variables on the fly with extraction data instead of adding them to the locker.

Network Workbench used full JS Rhino for post-processing while AIQ post-processing is very limited.

Navigation

To Navigate to Network Workbench, after you log in, Expand the Record option in the left navigation and click Network Workbench.

Validations

Several validations could be added by providing the Validation Name, choosing what method, and providing the request details.

Responses can be validated for the following formats:

Assertion Types:

In the above example, any request matching .*status.json should have a JSON object called config which should have a status integer with a status code of 100.

Validations can be enabled or disabled using Disable/Enable Toggle.

Multiple validations can be added using Add button, Existing Validations can be updated using the Update button and can be removed using the Remove button.

Extractions

Extractions will create variables on the fly with extraction data instead of adding them to the locker. The variables are created with a $ at the beginning of the variable name, extraction will find any HTTP Request which matches .*/learning-area/javascript/oojs/json/superheroes.json

It will process the response as JSON and will get the string "homeTown", it will create a variable $secretBase with results. The $ is added at the beginning of the variable name. The variable could change value during the test if a subsequent call also matches the request URL (in this case .*/learning-area/javascript/oojs/json/superheroes.json)

Formats and Examples

JSON Format

Follows the same format as the AIQ JSON format. For this JSON,

{
"users":[
{
"username":"John"
},
{
"username":"Jane"
}
]
}

To get the first username ("John") the target should be

users[0].username

To get the second username ("Jane") the target should be

users[1].username

PDF Format

The example below will show how to extract the contents of a downloaded PDF page and perform some assertions on the same.

Steps for the scenario:

Navigate to "https://www.w3.org/WAI/standards-guidelines/wcag/20/glance/ "

Assert the word "Perceivable" in the downloaded pdf file.

4

If we inspect the element of the pdf, it will show the request which is what you will need to add to the extractor defining a variable.

Go to Network Workbench

Click the Extractions Tab and provide the mentioned values from the screenshot.

Target:

HTTP:

TEXT:

Given the request's response is: "This is the ID Id=ABCDEF." then the TEXT extractor can use regular expressions as target values

HTML / XML:

Given the request's response is an XML or HTML then the this extractors can use XPath expressions as target values

STRING Format

Given the request's response is: "This is the ID Id=ABCDEF." with 25 characters, then the STRING extractor can use

Network Workbench files will have a .netx extension.

Now how to use this file in JS / Test Designer?

Below is a Javascript example file that calls the .netx file and performs the other steps of downloading the pdf and then performing the assertions:

addNetworkLibrary("{ds}/PDFTest.netx");
        
prepareDomain("https://www.w3.org  ");
navigateTo("https://www.w3.org/WAI/standards-guidelines/wcag/20/glance/  ");
click(link("WCAG 2 at a Glance (PDF) A4"));
        
log($pdfData);
        
assertContains($pdfData,"Perceivable");
        

Note: It is recommended to add addNetworkLibrary as the very first step, even before navigating to.

Example with zip Extractor

API Validation workbench also supports extracting the contents of a zip file and also checking the contents inside certain files and also checking asserting some of the metadata of the file (size of the file for example).

The below example shows how to test this scenario using a Network workbench.

Zip Content Extractor

Below is an example of a JS Script that navigates to a site to download the zip file and validates the contents of a file inside the zip.

prepareDomain("https://appvance-qa.s3-us-west-2.amazonaws.com");
        
navigateTo("https://appvance-qa.s3-us-west-2.amazonaws.com/qa/folder.zip");
        
wait(10000);
        
log("ZIP Content: "+$ZIPContent);
        
var text = $ZIPContent;
        
assertTrue(text.startsWith("Appvance"));
        
assertTrue(text.contains("$INSTALL_PATH"));

JS Script

Network Workbench Definition

Output

Zip MetaData Extractor

Below is an example of a JS Script that navigates to a site to download the zip file and validates the metadata (size) of a file inside the zip.

addNetworkLibrary("{ds}/ZIPMetaData.netx");
        
prepareDomain("https://appvance-qa.s3-us-west-2.amazonaws.com");
        
navigateTo("https://appvance-qa.s3-us-west-2.amazonaws.com/qa/folder.zip");
        
wait(10000);
        
log("ZIP META DATA: "+$ZIPMetaData);
        
var data = $ZIPMetaData;
        
var size = JSON.parse(data).size;
        
assertEquals("726 bytes",size);

JS Script

Network Workbench Definition

Output


Last updated: March 18, 2024

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

Validation Workbench Overview

Introduction

Usually, validations in the realm of scripting are very limited. The process is normally several actions, then validations, then actions.

That is standard and also a good approach, but as applications grow bigger, these “dot” validations don’t suffice as there could be several other places that behave incorrectly during the script but it was not detected, or just detected by one test case and then overlooked.

These kinds of issues could be detected by a human easily but were hard to address by automated scripts.

To increase the power of issue detection during scripting, Appvance created Validation Workbench which does “extra” validations during Scripting/AISG.

These extra validations consist mainly of 5 elements

So a single script with only 10 lines of codes, and 1000 validations, after every action (click, setValue, type, setSelected, etc.), will check how many of the 1000 validations should be evaluated, and if they should, it will process it automatically.

This enhances the power of the script without affecting its readability/size.

Appvance provides 2 ways of creating validation, through the Validation Workbench & using a CSV file.

Validations Workbench is a Test Designer submodule in which you can create and modify more structured and personalized validations, verifying automatically if validations are successful, failed validation. Validations workbench uses a trigger as a condition to run the validation.

This validation workbench is not related to any SmartTags or it is not related to (independent of ) any Test Designer script, Test Designer step, Scenario Editor, Scenarios, checkpoint tab in Test Designer, etc.

Created validations can be used in Test Designer scripts which can be triggered automatically and also the validation workbench can also be used in AISG.

In simple terms, it works this way:

  1. Where to look

  2. What to do there

  3. What is the pass or fail criteria

The Validation Workbench has a .valid extension.

Navigation

  1. Login to AIQ as Admin or a User

  2. Expand the Test Designer Section

  3. Click Validation Workbench

Validation Workbench and Options

Summary

The summary tab will give the overall view of the defined validations and Actions in a tabular format with the Name, Trigger Type, Validation Type, Pass type, Match, and Target.

Clicking these names will directly take you to the defined Action or Validation.

You can also sort columns, Search and use reload to refresh the list.

Actions

In the Actions Tab of the validations, you would be able to create javascript functions to get values. You would be able to get values from request, extract text, etc and store it in a variable. Then you can use that variable in the Validations tab.

Example below:

Validations

The validation tab is where the validations are defined and saved. Below you will see all the possible validations that can be defined and triggered.

Validation Name: Provide any meaningful name to define the name of the validation, in Test Designer scripts or AI, the validation names are the reference that would be displayed, even in the logs of the Test Designer script, validation names would be displayed when they are triggered and evaluated.

Pass When:

There are 3 options,

  1. Condition Succeeded: When this is chosen, we are telling the validation should be succeeded when the condition defined is true

  2. Condition Failed: When this is chosen, we are telling the validation should be succeeded when the condition defined is false

  3. JavaScript: When this is selected, a text box will be displayed, this will receive a parameter that is defined from a CSV file (DPL). To use this, there should be a CSV file created with some data.

This option is a combination of both Condition Succeeded and Condition Failed. A variable is defined which gets the value from the CSV file from the Test Designer IDE and if it's passed, it will work as Condition Succeeded, else if the condition fails, it works as Condition Failed.

Below is one example of how this works:

Here is a Test Designer script that logs in to AIQ and based on whether the logged-in user is an admin or a user, a validation of license link is triggered.


As you notice that the CSV file has entries admin and user, this data is passed to the validation workbench as shown below.

In the example, if you notice Pass when, the text box next to it is defined as - $actualUser==='admin'?'pass':'fail'

When the value passed is admin, the $actualUser will get the value as admin, which means the condition is true, and based on the validation defined if it finds the text 'Admin Options' it will check for the locator 'link("licenseLink")'

Similarly when the value passed is user, the $actualUser will get the value as 'user', which means that the condition is false, and based on the validation defined, it works as Condition failed, and the validation would be triggered when the Text 'Admin Options' is found and the validation triggered would be to check if 'link("licenseLink")' does not appear on the page.

Enable and Disable option:

You can enable or disable validations using this toggle, the disabled validations will not be used or triggered in Test Designer or AISG.

Add and Delete:

Add button is used to add the validations after filling or choosing values from the drop-down.

The delete button is used to delete the validation chosen.

After making any changes, it is required to save the validation file to take the updates.

Trigger By

There are 9 possible ways of triggering the validations

  1. Static Text Found: When trigger by is chosen to be Text Found, the trigger is activated as soon as it finds the provided Text in the Text Field next to the Trigger by option (As soon as the text is found in the application being tested);

  2. Image Found: When this option is chosen, the user is presented with the browse option to browse the image file, the trigger is activated when the browsed image is found on the application under test

  3. Element Found: With this option, the trigger would be activated based on the Locator chosen, the locator is something that can be copied from a Test Designer script, once the locator is found in the application under test, this trigger would be activated for the validation

  4. JS returns true: Choosing this option, a JS call can be written in the console, the trigger will be activated when the JS code returns true

  5. Manual Call: With the Manual Call trigger selected, you have to specify the validation manually in Test Designer scripts, Else this validation will not be triggered

    1. Quick Example Below:

      ManualTriggerCheck is the validation name that is used in the below Test Designer example

  6. Always: This trigger would always be activated for all the steps and for all the paths that the AISG takes, and there could be validation failures when the validation is not found and the trigger is always.

  7. JS Text Found

    Validation will get triggered if the result of a JS expression is found on the web page / mobile app

  8. Every Trigger

    This validation will only get triggered if every sub trigger succeeds.

    Valid options for sub triggers are Element Found, Static Text Found, JS Text Found, and JS returns true.

    You can add and remove sub triggers with the + and - signs respectively

  9. Any Trigger

    This validation will get triggered if at least one trigger succeeds.

    Valid options triggers are Element Found, Text Found and JS returns true.

    You can add and remove triggers with the + and - signs respectively.

Some options should be chosen with care.

Validation Type:

There are 5 Validation types described below.

  1. Text Present: Text Validation is done when this validation type is chosen, you will have to provide the Expected text value, as this is JS code, the expected value should be written in quotes.

    The values can also be driven from the CSV sheet, an example in Driving Validation from CSV will show the usage and syntaxes.

  2. Image Exists: This will validate whether the browsed image is available on the application under test

  3. Text Present in Element: Text Present in Element will look for the text in the locator, the locator follows the Test Designer syntax

    The Expected value is a text that should be mentioned in double-quotes since the expected value is in JS Code, Expected value can also be driven from a CSV file

  4. Element Exists: This is a simple Element that Exists on the page validation, much like an asset that exists in Test Designer, it follows the same syntax as in the Locator field

  5. JS Code: This option allows you to write a JavaScript code to elaborate a more structured and personalized validation

Adding Validations with multiple locators of the same object

There could be instances where a single object on the page would want to be referenced by multiple accessors like an AND condition to meet the criteria, below are some examples to define multiple locators for the same object.

  1. byJQuery("span[class=info][title='Ruby on Rails Bag']")

    The above approach is by using JQuery, class, and title of the object are used to refer to the same object.

  2. span({"className":"info","title":"Ruby on Rails Jr. Spaghetti"})

    This method again uses className and title to refer to the same object.

File Management

  1. File > New: This option is used to create a new validation file, if you already have a validation file open that is not saved, File > New will ask to save the file and then let the user create a new one.

  2. File > Open: This option is used to open an already saved validation file that has at least one valid validation added. Validation file has .valid extension

  3. File > Save: This option is used to save the validation file either locally or in the configured repository, if the file is being saved the first time, this behaves like the Save As option.

  4. File > Save As: This option can be used to save the already saved file in a different location.

When the file is saved, the file name would be displayed in green, if there are changes in the file name would be shown in Orange, and after saving the file, it will change the color to green.

Validation Workbench in Test Designer

Let's start by creating some of the examples:

An application that is picked for example is our >https://demosite.appvance.com

  1. Example 1: Checking for the Login button based on the Home link available.

    You will have to save the defined validation file.

    Go to Test Designer

    Right-click and add an empty step.

    Choose the Action to be "Add Validation Workbench" - Browse the saved validation file.

    From the 2nd step, right-click and do record from here to record your script.

    Or if you already have a script, you can add the first line to browse the validation workbench and save the Test Designer script.

    As you can notice in the below screen-shot, the validation would be automatically triggered as soon as the script finds the Locator "link("Home")" and it validates looking for "link("Login")"and the validation would be successful when the element is found else the script would be failed with the message saying the validation was unsuccessful.

  2. Example 2: Trigger by Text and Validation Type Text

    In this example, the validation would be triggered when the text "Shop by Categories" is found in the application and the validation would be to check if the text "Bags" is available".

    Below the Test Designer script, you will also notice that all the applicable validations would be triggered and executed as well, in this case, both example 1 and example 2 validations were triggered in the same step and were executed.

  3. Example 3: Triggering by image and validating the text

    The below example shows how the image is being browsed and the validation is done.

    In Test Designer, the full-screen screenshot is taken as well when the trigger is activated and the validation is done.

  4. Example 4: Pass When Failed Condition

    Below is another example where we could make sure a locator or image or text or a JS is not present in the application, for which this condition could be used to trigger and make sure the image or locator or text is not present in the application under test.

  5. Example 5: Trigger Always

    This example will show you the trigger by always, which will trigger the validation for all the steps.

    Driving Validations from a CSV

    The below example shows you how the validation data can be passed from a CSV file.

    This example is using the JIRA system and triggers the validation of the priority passed based on the mentioned Text.

    The $Priority that is defined in the validation workbench will use the value from the CSV sheet that is browsed by the Test Designer.

Validation Workbench in AISG

To use validation workbench in AISG and perform automatic validations.

  1. Go to Create AISG under AI Scripting

  2. Choose Web

  3. Choose the Scan Type and Enable Use Validation Workbench option

  4. Browse the validation file (.valid file)

  5. Rest would be similar steps as to how the AISG is generated

  6. Once the AISG is done, go to the Validations tab to check the passed and failed validations with the validation names.

    The failed validations will have the option to download the .js and .ds files to check the failures


FAQ

  1. How different is the Validation Workbench when compared to what we already have in the SmartTag workbench With Validation Workbench you can create more elaborated validations which automatically verify if the validation is successful or if it fails without assigning to a smartTag? Also, you can create validations with js code that will receive parameters and use them to decide if is needed to run the validation or not.

    1. These validations are true validations of any sort NOT tied to a tag but anything…a state a page an API a UX item. And validate the throughput of the application.

  2. When it comes to ds3 scripts, we can add a lot of validations using the Checkpoint tab itself, how is this new wb going to help? With Validations Workbench you can create more validations types, that are more personalized than using Checkpoint tab validations, for example, you can make your own JS validations, call them manually or automatically.

    1. If you use the same validation workbench in several scripts then a single modification to the validation workbench will update all the related scripts, as opposed to in-script validations that will require modifying all related scripts.

  3. I define say 10 validations and that is browsed in Test Designer, Now will that validation be done on every step in Test Designer? if so will it not impact the performance? For each step, it would be run all the validations, which means that whether we have for example five steps and ten validations, it will be run five times the 10 validations that it´s equal to 50 validations ran, and it will consume resources.

    1. What is tested every time is not the full validation but the trigger condition, but yes that has a performance impact. If you set the trigger to manual for all validations then there is NO impact on performance and you still get the benefit of the centralized definition of commonly used validations.

  4. The previous version of validation UI had Pre-Action/Post-Action and there was a note saying if the page refreshes, post-action validation won't work. So now the current case handles it? Whatever new validations are added now, whether it will be performed pre-action or post-action and which step does that corresponds to because we don have any link to the element of the DS script step in it. All validation workbench will work on the same page. SmartTag validations are independent of these workbench validations, so, pre/post actions remain in the product as before.

  5. There were many Operations to add in validations such as - equal to/not equal to – quite a list from existing. Are we going to support all this here basically is this going to replace the existing one? How are we going to tag it to SmartTags? Validation Workbench has its operations, which are Boolean validations that are triggered when they find the condition, the other ones are not going to be replaced.

  6. In the validation type drop-down when we select an image that exists then on what criteria it will match that image on the application web page? It will match the image on the application web page either by source code written in it or by the term called “footprint” .i.e it recognizes the particular image on the web page.

  7. AISG - if we are calling validation in custom JS, it should always be added as the last line of the custom JS for it to work, if it is added in the middle of the steps, it does not trigger the validation. Is this statement correct?

    1. No. Explicit validate(“name”) will cause that validation “name” To be validated in the place where that line is added. The same with forceValidations.

    2. The automatically triggered validation are the ones that only get triggered in the last step of a custom action.

  8. setRealtimeValidations(false) - Setting this upfront in the global setup js, it does not trigger any validations right?

    1. If we do not want to trigger any validations, why would anyone want to browse the validation file and set this to false

    2. If you do not want real-time validations then can change the validation trigger to manual. Guess usage in setup is only to avoid automatic validations in setup steps.

  9. forceValidation() - Should this again be called as the last step of a page, and this will trigger all the validation that applies to that page/page state.

    1. Is this correct?

    2. Not required. That will be done automatically. The only usage of that is when want to add a check of validations in between the steps of a custom action

  10. validate(ValidationName) - Calling this in BP as the last step (custom JS), will this trigger the validation irrespective of the trigger by set in the validation workbench?

    1. Suppose, for example, the validation was set to trigger by Image, and we call validate(validationName) in the AISG, will this trigger the validation even if it does not find the trigger by (image)?

    2. Will check the trigger condition. If the trigger condition is not met then validation will not be checked


Last updated: August 25, 2023

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

Use Visual Accessors for Web Testing

What is a Visual Accessor?

Visual Accessors are image based accessors which can be used to enhance your test scripts in situations where traditional code-based accessors will fail. AIQ will capture an image of the website and then crop the surrounding boundaries of the element that you are working on. During playback it takes the image and applies a feature based matching algorithm which creates a pattern from the image and uses that to locate the image on the webpage.

Using a Visual Accessors means that AIQ is not only looking at just the code elements in a page, the AI is also looking at the visual elements on the page.

Visual Accessors vs Visual Hints

Visual hints are images in test scripts that generally take the place of comments. They are not actual accessors. Only AIQ uses true Visual Accessors.

For example, AIQ can now locate a button and automatically understand the boundaries of the button, its location on the page as well as the visual element of the button to identify it going forward. This means that if in the future, the code-based accessors have changed, or are no longer present, the Visual Accessor used for the button will allow the test to run without failing because of the failure of the other accessors.

Visual Accessors in AIQ

The ability to use visual accessors has been added to the Web Testing IDE in AIQ 4.10.0. This functionality means that AIQ can now automatically collect images and used them as valid accessors.

These visual accessors allow you to capture images into your test scripts. Images will be linked to the script so that the script is aware of any images.

Previously, accessors for images was limited to the XY coordinates. That means that your scripts run the risk of being somewhat brittle if an image moved a little bit to the left or to the right. Visual accessors make your scripts more resilient and require less maintenance.

Visual accessors are similar to smart tags-based images, the result is a boundary that indicates where the image is located and not a specific HTML tag.

Visual accessors for web testing compliments the visual accessors for mobile testing functionality that was introduced in AIQ 4.9. See Visual Accessors for Mobile Testing for more information.


Last updated: September 29, 2023

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

Global JSON File for Scenario Editor Tests

The Global JSON file (global.json) is a configuration file that contains settings that determines how AIQ operates and interacts with applications under test.

The global.json file is located in the ..\aiq_distribution\NetworkProxy\config directory.

Many of these configuration settings are set in the various Test Options dialogs in the AIQ user interface. Changing a setting there will update the global.json file.

See the following topics on setting test options in AIQ:

If you need to make any manual changes, you can edit the file directly in Notepad++ or similar editors. AIQ must be restarted after editing the global.json file for any changes to take effect.

Be very careful when making any changes to the global.json file. The settings in this file directly affect the behavior of AIQ.

General Settings

The "general" section contains a variety of configuration settings. Below are some examples of those settings. For ease of reading, the "general" are broken into several subsections in this topic.

    "general": {
        "printURLsInjectedJS": false,
        "createFilesResponses": false,
        "enableProxyAtOSLevel": false,
        "interactive": false,
        "incognitoMode": true,
        "visualAccessor": false,
        "readSocketRetries": 0,
        "stepTimeOutMiliSeconds": 120000,
        "printURLs": false,
        "xpathSearch": false,
        "overrideProxy": {
            "server": "127.0.0.1",
            "portHttps": 9998,
            "password": "",
            "excludeDomains": "127.0.0.1,localhost,www.staticDomain.com,*.wildcardDomain.com",
            "urlPac": "",
            "portHttp": 9998,
            "enabled": false,
            "username": ""
        },
        "connectionTimeout": 60000,
        "minBrowserStartDelay": 1000,
        "apiEnabled": true,
        "negotiate": {
            "password": "PASSWORD",
            "domain": "",
            "workstation": "",
            "enabled": false,
            "username": "USERNAME"
        },
        "aiAccessorPreferences":false,
        "debug": false,
        "displayNums": true,
        "consoleLog": false,
        "setDownload": [
            "application/pdf",
            "image/jpeg",
            "image/apng",
            "image/webp",
            "text/xml",
            "image/png",
            "application/xml",
            "video/mp4"
        ],
        "proxy": {
            "httpPort": 9090,
            "httpsPort": 9091,
            "enabled": true
        },
        "useOSProxy": false,
        "ntlm": {
            "password": "yourpassword",
            "domain": "https://yourdomain.com",
            "workstation": "https://yourdomain.com",
            "enabled": false,
            "username": "yourusername"
        },
        "inject": true,
        "compatibility": false,
        "autoScrollLogs": true,
        "setFindOnlyEnabled": true,
        "forcedShadowDom": false
    },

Accessor Preferences

The "edit" section contains the accessor preferences order and priority that you set in the Test Options dialog in Web Designer, Test Designer (Classic) and Mobile Designer.

    "edit": {
        "mobileAccessorList": [
            "SmartTags",
            "AccessibilityId",
            "Id",
            "Predicate",
            "ClassChain",
            "XPathAccessibilityId",
            "XPathId",
            "XPath",
            "XPathText",
            "XPathIndex",
            "XPathContains",
            "XPathClass",
            "XPathAbsolute",
            "Image",
            "image",
            "text",
            "Custom",
            "XY",
            "Unknown"
        ],
        "accessorList": [
            "SmartTag",
            "Parent",
            "AttrTitle",
            "XPathId",
            "AttrClass",
            "XPathName",
            "Id",
            "AttrName",
            "AttrValue",
            "AttrAlt",
            "AttrHref",
            "Src",
            "Text",
            "XPath",
            "XPathClass",
            "XPathText",
            "AbsoluteXPath",
            "RelativeXPath",
            "TableXPath",
            "Attribute",
            "Image",
            "JQuery",
            "Index"
        ]
    },

 

Reviewer question - what is the difference between excluded and blocked domains in a practical sense in AIQ?

Excluded Domains

The "exclude" section contains all the domains that will be excluded during test recording playback.

This is a sample from the global.json file.

            "exclude": {
                "urls": [],
                "domains": [
                    "*googletagmanager.com",
                    "*labs.iadvize.com",
                    "firefox.settings.services.mozilla.com",
                    "firefox-settings-attachments.cdn.mozilla.net",
                    "location.services.mozilla.com",
                    "shavar.services.mozilla.com",
                    "tracking-protection.cdn.mozilla.net",
                    "content-signature-2.cdn.mozilla.net",
                ]

 

The above sample has been edited for length. The default global.json file contains more excluded domains.

Blocked Domains

The "block" section contains all the domains that need to be blocked during test recording playback.

This is a sample from the global.json file.

            "block": {
                "urls": [
                    "*/baselogin4.js",
                    "*/LoginMarketingSurveyResponse.js"
                ],
                "domains": [
                    "*eloqua.com",
                    "*doubleclick.net",
                    "*adsafeprotected.com",
                    "*postrelease.com",
                    "*script.crazyegg.com",
                    "*seal.websecurity.norton.com",
                    "*s7.addthis.com",
                    "*seal.digicert.com",
                    "*v1.addthis.com",
                    "*v1.addthisedge.com",
                    "*google-analytics.com"
                ]

Repository Configurations

These sections contains the configuration settings for your chosen repository types. See Repositories for links to the information on configuring various types of repositories.

This is a sample of how an Amazon S3 repository configuration appears in the global.json file.

    "aws": {
        "s3": {
            "secretKey": "SECRETKEY",
            "secret": "",
            "enabled": false,
            "key": "KEY"
        }
    },

Platform

The "platforms" section contains platform and OS related settings and paths including command line options. There are separate sections for Linux, Windows, and Mac OS.

There are options for various browsers and mobile devices. See the Browser Options section for examples of browser options.

    "platforms": {
        "linux": {
            "browsers": [
                {
                    "paths": [
                        "/usr/bin/google-chrome-stable",
                        "/usr/bin/google-chrome",
                        "/usr/bin/chromium-browser"
                    ],
                    "name": "ChromeSystemProfile",
                    "options": [
                        {
                            "name": "disable-web-security",
                            "value": "false"
                        },
                        {
                            "name": "ignore-certificate-errors",
                            "value": "false"
                        }
                    ]
                },


    [SESCTIONS DELETED]

                {
                    "groupName": "mobile",
                    "paths": [
                        "C:/Program Files/Google/Chrome/Application/chrome.exe",
                        "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
                    ],
                    "name": "iPad",
                    "options": [
                        {
                            "name": "window-size",
                            "value": "784,944"
                        },
                        {
                            "name": "window-sizeOriginal",
                            "value": "768,812"
                        },
                        {
                            "name": "disable-web-security",
                            "value": "false"
                        },
                        {
                            "name": "experimentalDS3",
                            "value": "--force-device-scale-factor=1"
                        }
                    ],
                    "userAgent": "iPad"
                },
                


    [SESCTIONS DELETED]


    },

The above sample has been edited for length. This sample shows the sections for Google Chrome on Linux and an iPad configuration for mobile testing. The default global.json file contains many more platform configurations.

Browser Options

This section shows command line options that have been set for Google Chrome. Note than you can set different options for different instances of a browser. The following sample shows different settings for Google Chrome, Google Chrome System Profile, and Google Chrome Headless browsers.

        "windows": {
            "browsers": [

                {
                    "paths": [
                        "C:/Program Files/Google/Chrome/Application/chrome.exe",
                        "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
                    ],
                    "name": "Chrome",
                    "options": [
                        {
                            "name": "disable-web-security",
                            "value": "false"
                        },
                        {
                            "name": "ignore-certificate-errors",
                            "value": "false"
                        },
                        {
                            "name": "disable-extensions",
                            "value": "true"
                        }
                    ]
                },
                {
                    "paths": [
                        "C:/Program Files/Google/Chrome/Application/chrome.exe",
                        "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
                    ],
                    "name": "ChromeSystemProfile",
                    "options": [
                        {
                            "name": "disable-web-security",
                            "value": "false"
                        },
                        {
                            "name": "ignore-certificate-errors",
                            "value": "false"
                        }
                    ]
                },
                {
                    "paths": [
                        "C:/Program Files/Google/Chrome/Application/chrome.exe",
                        "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
                    ],
                    "name": "ChromeHeadless",
                    "options": [
                        {
                            "name": "no-sandbox",
                            "value": "true"
                        },
                        {
                            "name": "ignore-certificate-errors",
                            "value": "true"
                        },
                        {
                            "name": "disable-extensions",
                            "value": "false"
                        },
                        {
                            "name": "disable-web-security",
                            "value": "false"
                        },
                        {
                            "name": "disable-gpu",
                            "value": "true"
                        },
                        {
                            "name": "experimentalDS3",
                            "value": "--disk-cache-size=1||--window-size=1920,1080||--force-device-scale-factor=1.0"
                        }
                    ]
                },

For example, Google Chrome command line options include:

Refer to the browser specific documentation for information on command line settings.


Last updated: March 18, 2024

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

Compare PDF Files in AIQ Web Tests

There are actions in the Test Designer that allows you to compare two PDF files. The report will detail all the changes, based on the rules that you specify, on a page by page basis between the two files.

For example, you can validate that all the elements on every page from the template PDF file appear on the same page in the dynamic PDF file with the same formatting.

These two PDF files in the comparison are:

You can compare certain elements in the two PDF files based on rules that you create. See Rules Based Comparison for more information.

You can compare the complete contents of the two PDF files to each other. See Comparing PDFs for more information.

This feature requires to open the port 9013 in the controller to be accessed from test nodes and end-user computers. See AIQ Required Ports for information on required ports.

Rules Based Comparison

You can create the rules by which the PDFs will be compared. Since you specify the rules during the comparison, you can create custom rules that can be used in very specific situations or rules that will be used for all of your comparisons.

Prerequisite: You must be familiar with writing regular expressions (regex) in order to author custom rules.

Considerations:

Sample rules.txt File

This is an example of a rules file used for comparing two PDF files. This comparison checks for the existence of specified content as well as how it is formatted (font / bold / size).

{
    "rules": {
        "policy": {
            "format": "^([A-Z]{2}[0-9]{8})",
            "fontFamily": "Arial",
            "Bold": "no",
            "Size": 12
        },"number": {
            "format": "^([0-9]{4}[A-Z]{3})$",
            "fontFamily": "Arial",
            "Bold": "no",
            "Size": 12
        },
        "plate": {
            "format": "(\\s[0-9]{7})",
            "fontFamily": "Tahoma",
            "Bold": "yes",
            "Size": 12
        },
        "created": {
            "format": "^([0-9]{2}\\s(de)\\s[a-zA-Z]{3,15}\\s(de)\\s[0-9]{4})",
            "fontFamily": "Helvetica",
            "Bold": "no",
            "Size": 11
        },
        "name": {
            "format": "^([a-zA-Z]{3,5}\\s[a-zA-Z]{3,5})$",
            "fontFamily": "Tahoma",
            "Bold": "no",
            "Size": 10
        }        
    }
}

Syntax of the Rules

Rules are created using regular expressions (regex). For example, the format attribute in the policy section of above sample code, checks for a policy number within the PDF with the following parameters:

The fontFamily, bold, and size attributes specify how the policy number is expected to appear in the PDF file.

If the comparison identifies a string that matches the format but does not match these expected display attributes that difference will be noted in the report.

Checking the Rules

You can compare the two PDF files just on the basis of the rules that you have created. Here is a sample of a script for that function.

Sample checkRules.js File

var $basefilename = "{mds}/OriginalFile.pdf";
var $comparisonfilename = "{mds}/NewFile.pdf";
var $rulesfilename = "{mds}/rules.txt";


var response = assertPDFRules($basefilename,$comparisonfilename,$rulesfilename);
var responseObj = JSON.parse(response);
var summaryRuleDiffs = responseObj.content.summaryRuleDiffs;
for(var idx = 0; idx < summaryRuleDiffs.length; idx++) {
    var matches = summaryRuleDiffs[idx].matches;
  log("-------------------------------------------------------------------------------------------------------");
  log("Page: " + summaryRuleDiffs[idx].pageId); 
  for(var matchId = 0; matchId < matches.length; matchId++) {
      log("     Rule Name: " + matches[matchId].name); 
    var rules = matches[matchId].rules;
    for(var ruleId = 0; ruleId < rules.length; ruleId++) {
      log("          Found: " + rules[ruleId].found); 
      log("          Match: " +  rules[ruleId].match); 
      log("          Font Expected: " + rules[ruleId].fontExpected); 
      log("          Font Found: " +  rules[ruleId].foundFont); 
      log("\r\n");
    }
    
  }  
}

Performing the Rules Check

From Services Workbench, load the checkRules.js file, and click Play Script. After the script has been run, the response tab is populated with the details of what rules were chcked and what was found, with any differences noted.

Sample Output on the Response Tab

   Rule Name: policy
      Found: AB12345678
      Match: AB12345678
      Font Expected: Arial
      Font Found: Helvetica

This is just the output for the policy element of the rules file.

Comparing PDFs

You can also compare the complete content of two PDF files. Here is a sample of a script for that function.

Sample compareJson.js File

var $basefilename = "{mds}/OriginalFile.pdf";
var $comparisonfilename = "{mds}/NewFile.pdf";

var response = comparePDF($basefilename,$comparisonfilename);

var objResponse = JSON.parse(response);

var response = objResponse.content;
log("-------------------------------------------------------------------------------------------------------");
log("Base Pdf: " + response.template + "                    Pages Count: " + response.templatePageCount);
log("Comparison Pdf: " + response.pdf + "                Pages Count: " + response.pageCount);
log("-------------------------------------------------------------------------------------------------------");
log("Differences per page:");
var pages = response.pages;
for(var idx = 0; idx < pages.length; idx++) {
      log("        Page: " +  pages[idx].pageId + ": " + pages[idx].differences + " differences.");   
}
log("-------------------------------------------------------------------------------------------------------");
var differences = response.dynamicPdf;
 log("PDF: " + response.pdf +  "\r\n " );
for(var idx = 0; idx < differences.length; idx++) {   
    log("        PageId: " + differences[idx].pageId  + ", Font: " + differences[idx].details.font );
    log("                Found: " + differences[idx].details.pdf + "\r\n");
    log("-------------------------------------------------------------------------------------------------------");
}

Performing the Comparison

From Services Workbench, load the compareJason.js file, click Play Script. After the script has been run, the response tab is populated with the details of what rules were chcked and what was found, with any differences noted.

Sample Output on the Response Tab

----------------------------------------------------
Base PDF: OriginalFile.pdf    Page Count: 3
Comparison PDF: NewFile.PDF   Page Count: 3
----------------------------------------------------
Differences per page:
   Page: 3: 1 differences
----------------------------------------------------
PDF: NewFile.PDF 
 
    PageId: 3, Font: Helvetica
            Found: $99.99
 

Explanation:

 

HTML Comparison Report

The comparison report lists the details of all differences to both text within the two PDF files.

Details include:


Last updated: October 14, 2023

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

WebDesigner: Configuring a node to run containerized Chrome

Dockerfile Dockerfile.linux-linux Dockerfile.macos-linux Dockerfile.windows Dockerfile.windows-linux Dockerfile.windows-windows 

Status: Development / validation. Do not enable for production until the acceptance checklist in the implementation progress log (documentation/BrowserManager/design/containerized-browser-pool-implementation-progress.md) is complete.

Overview

DSServer can run Chrome sessions inside disposable Docker containers instead of a local browser profile. Each session leases a container from a pool; when the session ends the container's Chrome process and lease directory are cleaned up and the container is reused. Local browser profiles keep working through the existing manager path — containerized Chrome is an additional profile (ChromeContainerized), not a replacement.

Source lives in DSServer/container-browser/ (Dockerfiles, shared browser-supervisor.py, baked extensions/, host guides under guides/, and global.json examples under config/). Installed AIQ packages use the release-matched container-browser bundle shipped with that release (see Installed AIQ package vs. source checkout).

Key concepts

Validation status

Scenario

Status

Windows 11 / Docker Desktop, Linux containers

VALIDATED Live DSServer MCP sessions (navigation, click, page queries, proxy injection, shutdown, container reuse); 2–10 container stress test, 11th-session rejection, 4 replacements

Windows 11 / Docker Desktop, Windows containers

VALIDATED Live Apple flow, 10-container stress, 4 same-container Chrome PID replacements, 20-second exhaustion retry

macOS Apple Silicon / Docker Desktop, Linux containers (amd64 emulation)

VALIDATED Sep 29, 2026, Chrome 154.0.8037.57: image load/inspect, standalone supervisor checks, pool startup, proxy probe, MCP discovery, navigation, stop and reuse; 10 concurrent sessions on 10 sites; replacement batches at 10–12 concurrency; 30 starts/navigations and 32 stops. Not a completed 100-session soak.

Windows Server 2025, Windows containers

RECIPE ONLY Not yet build/live tested

Native Linux, Docker Engine

RECIPE ONLY Not yet build/live tested

Broader action parity / production rollout

PENDING

The macOS concurrency run exposed a race between explicit stop and the browser watcher: both removed the same JVM shutdown hook, throwing a NullPointerException and leaving stale session inventory. The lifecycle code now claims and clears the hook atomically; the post-fix run was clean.

Evidence: documentation/BrowserManager/evidence/containerized-chrome-apple-2026-09-23/ and containerized-chrome-windows-2026-09-24/.

Step 1 — Pick the recipe for your node

DSServer host

Docker engine mode

Dockerfile

global.json example

Docker host key

Guide

Windows 11

Linux containers

Dockerfile.windows-linux

config/windows11-dual.json

dockerHosts.desktop

guides/windows-11.md

Windows 11

Windows containers

Dockerfile.windows-windows

config/windows11-dual.json

dockerHosts.desktop

guides/windows-11.md

Windows Server 2025

Windows containers

Dockerfile.windows-windows

config/windows-server-2025-windows.json

dockerHosts.server

guides/windows-server-2025.md

macOS

Linux containers

Dockerfile.macos-linux

config/macos-linux.json

dockerHosts.desktop

guides/macos.md

Linux

Linux containers

Dockerfile.linux-linux

config/linux-linux.json

dockerHosts.engine

guides/linux.md

The named Dockerfiles make each host/engine combination explicit. Dockerfile (Linux) and Dockerfile.windows remain canonical; the three Linux recipes produce the same appvance/ds-chrome:local image, and Dockerfile.windows-windows mirrors Dockerfile.windows. If you change a canonical file, keep the named copies aligned.

Installed AIQ package vs. source checkout

Step 2 — Common configuration (global.json)

Each example file in config/ contains a complete root-level containerBrowsers object. Copy only that object into global.json, replacing any previous containerBrowsers object and keeping every other property. If the installed configuration already has the object, update it in place.

Required edits before starting DSServer:

  1. ownerId — stable across restarts and unique to one DSServer deployment. On startup DSServer removes labeled containers belonging to this owner and pool before accepting leases; two running servers sharing an ownerId would delete each other's containers.
  2. dockerHosts.<name>.context — set to the output of docker context show (check docker context ls too). The adapter uses the configured context explicitly for every Docker call and does not inherit the shell's current context. Common values: default, desktop-linux (Docker Desktop on Mac).
  3. network.dsProxyHost — the address containers use to reach DSServer's HTTP proxy (port typically 9090):
    • Docker Desktop (Windows 11, macOS): host.docker.internal
    • Linux Docker Engine: the bridge network gateway (replaces REPLACE-WITH-DOCKER-BRIDGE-GATEWAY-IPV4)
    • Windows Server 2025: the nat network gateway (replaces REPLACE-WITH-HOST-NAT-IPV4). Native Docker on Windows Server has no host.docker.internal.
  4. Pool size (minSize / maxSize) — examples start 2 warm containers and allow up to 20 (Linux) or 10 (Windows). The maximum is a ceiling, not a recommendation; size it for host memory and CPU.

Configuration reference

Setting

Notes

enabled

false (or omitting containerBrowsers) disables the feature explicitly.

ownerId

Stable, unique per deployment.

dockerHosts.<name>.context or explicit endpoint

Choose one. An explicit TCP endpoint requires tls with CA, client certificate, and key paths and is rejected without them.

apiVersion

"auto" uses normal Docker CLI/server negotiation. A numeric value sets DOCKER_API_VERSION only for commands this adapter launches.

network.dsProxyHost

Container-reachable address of DSServer's HTTP proxy (see above).

runtime.platform

Linux pools: keep linux/amd64 — the image uses Google's amd64 Chrome package. Do not simply change it on arm64 hosts.

runtime.isolation (Windows pool)

process by default; change to hyperv if the host needs Hyper-V isolation (change the image build flag too).

minSize / maxSize

Warm containers / ceiling.

Image / allowUnpinnedImage

The mutable :local tag with allowUnpinnedImage: true is development only. Production must pin an approved image digest.

acquireRetryIntervalMs / acquireRetryCount

Example 5000 / 4 → a session start waits up to 20 s for a free lease. A released lease wakes waiters immediately. On deadline, startup fails with POOL_EXHAUSTED and no session is retained.

acquireTimeoutMs

Legacy, still supported, cannot be combined with the retry settings above.

cdpAdvertisedHost

Linux pool: host DSServer uses to reach the published CDP port; must be reachable from DSServer.

cdpContainerPort

Supervisor CDP relay port inside the container (9222). Chrome itself listens on the next port (9223), bound to container loopback.

extensionList (profile option)

Comma-separated IDs of extensions baked into the image under extensions/<id>/. Host extension directories are not copied at session time.

Step 3 — Host-specific setup

Linux host (Docker Engine, Linux containers)

Assumes rootful Docker Engine on a Linux/amd64 host, the standard bridge network, and DSServer on the same host.

  1. Install Docker Engine per the official instructions for your distribution and start the daemon. Give the DSServer service account access to the daemon (socket/group access is root-equivalent — restrict to trusted operators). Confirm:
    docker info --format '{{.OSType}}'    # must print: linux
    docker context show
  2. Build from the repository root:
    docker build --platform linux/amd64 -f DSServer/container-browser/Dockerfile.linux-linux -t appvance/ds-chrome:local DSServer/container-browser
  3. Find the bridge gateway and subnet:
    docker network inspect bridge --format '{{(index .IPAM.Config 0).Gateway}}'
    docker network inspect bridge --format '{{(index .IPAM.Config 0).Subnet}}'
  4. Copy containerBrowsers from config/linux-linux.json; set ownerId, dockerHosts.engine.context, and replace REPLACE-WITH-DOCKER-BRIDGE-GATEWAY-IPV4 with the gateway.
  5. Make DSServer's HTTP proxy listen on an interface reachable through that gateway (typically 9090) and allow inbound traffic only from the bridge subnet. 127.0.0.1 inside a container is not the host.
  6. Start DSServer; verify one session navigates, close it, start a replacement. CDP is published only to host loopback, so DSServer must run on this host.

arm64 Linux hosts: don't just change runtime.platform. Use a compatible, validated browser image or explicitly accept and test amd64 emulation.

Windows 11 (Docker Desktop, Linux and/or Windows containers)

Docker Desktop runs one engine mode at a time. config/windows11-dual.json defines both pools; DSServer registers only the one matching the active engine at startup, so switching modes requires a DSServer restart.

  1. Prepare Docker Desktop. Supported Windows 11 build with hardware virtualization enabled. Install Docker Desktop for all users — the per-user install does not support Windows containers. Windows container mode requires a Pro/Enterprise edition. For the ltsc2025 image with process isolation the host build must be compatible with Windows Server 2025 images (check Microsoft's version compatibility matrix).
  2. Build the Linux image. Select Linux containers in the Docker tray menu, confirm docker info --format '{{.OSType}}' prints linux, then:
    docker build --platform linux/amd64 -f DSServer/container-browser/Dockerfile.windows-linux -t appvance/ds-chrome:local DSServer/container-browser
  3. Build the Windows image. Switch to Windows containers, confirm the OS type prints windows, test host/image compatibility first, then build:
    docker run --rm --isolation=process mcr.microsoft.com/windows/server:ltsc2025 cmd /c ver
    docker build --isolation=process -f DSServer/container-browser/Dockerfile.windows-windows -t appvance/ds-chrome-windows:local DSServer/container-browser
    If process isolation isn't supported, review Hyper-V isolation requirements and change both the build flag and the Windows pool's runtime.isolation to hyperv. For build-only DNS problems add --build-arg BUILD_DNS=<working-DNS-IP>.
  4. Configure DSServer. Copy containerBrowsers from config/windows11-dual.json; set ownerId; set dockerHosts.desktop.context (change from default if needed). The DSServer process account must be able to run the Docker CLI — typically membership in docker-users, followed by sign-out/sign-in.
  5. Proxy. DSServer's proxy must be reachable at host.docker.internal:9090 from containers: listen on a container-reachable interface and add a Windows Firewall rule allowing only the Docker private subnet to that port.
  6. Start DSServer after selecting the engine mode. Verify one session, stop it, start a second to check reuse before increasing load. Lower minSize/maxSize on a smaller workstation.

Windows Server 2025 (native Docker, Windows containers)

Use a Windows Server 2025 host. Docker Desktop is not supported on Windows Server; install a native Windows-container runtime (Docker CE/Moby). This recipe provides no Linux containers — those need a separate Linux Docker host and a reviewed remote-network design.

  1. Install updates; make sure the host can reach Microsoft Container Registry, Chrome for Testing downloads, and Python downloads during the image build. Reserve disk and memory for the Windows base image and the pool.
  2. Set up the container host per Microsoft's Windows Server container-host guide. In elevated PowerShell (review the script and your org policy first — it enables container features and may reboot):
    New-Item -ItemType Directory -Force C:\setup | Out-Null
    Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1 -OutFile C:\setup\install-docker-ce.ps1
    powershell.exe -ExecutionPolicy Bypass -File C:\setup\install-docker-ce.ps1
  3. After reboot, verify:
    Get-Service docker
    docker context show
    docker info --format '{{.OSType}}'    # must print: windows
    docker run --rm --isolation=process mcr.microsoft.com/windows/server:ltsc2025 cmd /c ver
  4. Build from the repository root:
    docker build --isolation=process -f DSServer/container-browser/Dockerfile.windows-windows -t appvance/ds-chrome-windows:local DSServer/container-browser
  5. Copy containerBrowsers from config/windows-server-2025-windows.json; set ownerId and dockerHosts.server.context (if not default). Run DSServer under an account authorized for the Docker daemon with docker on PATH.
  6. Find the NAT gateway and subnet:
    (docker network inspect nat | ConvertFrom-Json)[0].IPAM.Config | Select-Object Subnet,Gateway
    Replace REPLACE-WITH-HOST-NAT-IPV4 in network.dsProxyHost with the Gateway. DSServer's proxy must listen on that interface, and Windows Firewall must allow the Subnet to the proxy port (typically 9090). Do not open it publicly.
  7. Start DSServer; verify one session, stop, start a replacement before growing the pool. CDP is only on each container's private NAT IPv4 and is never published.

macOS (Docker Desktop, Linux containers)

Docker Desktop runs Linux containers in a VM. On Apple Silicon the linux/amd64 image runs under emulation — slower and heavier than an x86-64 Linux host. This procedure targets an installed AIQ package with its release-matched container-browser bundle.

  1. Verify Docker Desktop.
    docker context show                                  # record it, commonly desktop-linux
    docker info --format '{{.OSType}}/{{.Architecture}}' # OS must be linux
    docker version
    uname -m                                             # arm64 on Apple Silicon (expected)
    On Apple Silicon, install Rosetta if arch -x86_64 /usr/bin/true fails (softwareupdate --install-rosetta), then in Docker Desktop Settings → General select the Apple Virtualization framework and enable Use Rosetta for x86_64/amd64 emulation on Apple Silicon.
  2. Build and inspect.
    cd <container-browser-bundle>
    docker build --platform linux/amd64 -f Dockerfile.macos-linux -t appvance/ds-chrome:local .
    docker image inspect appvance/ds-chrome:local --format '{{.Os}}/{{.Architecture}}'   # must print linux/amd64
  3. Smoke-test the image before involving DSServer:
    docker run -d --name ds-chrome-macos-smoke --platform linux/amd64 -p 127.0.0.1::9222 appvance/ds-chrome:local
    docker exec ds-chrome-macos-smoke python3 /opt/appvance/browser-supervisor.py status     # idle
    docker exec ds-chrome-macos-smoke python3 /opt/appvance/browser-supervisor.py manifest   # JSON: protocol, /usr/bin/google-chrome, Chrome version
    docker rm -f ds-chrome-macos-smoke
  4. Configure. Merge containerBrowsers from the bundle's config/macos-linux.json into <AIQ-install>/config/global.json. Set ownerId and dockerHosts.desktop.context; keep runtime.platform: linux/amd64 and dsProxyHost: host.docker.internal. On Apple Silicon start small (e.g. minSize: 2, maxSize: 10) and grow only after measuring memory, CPU, launch latency, and CDP responsiveness.
  5. Restart AIQ. Start Docker Desktop first, stop AIQ with the installation's normal procedure, then start it again (e.g. cd <AIQ-install> && ./startds.sh). Do not run Maven or a replacement JAR.
  6. Verify using Step 4, including verify-macos.sh.

Step 4 — Verify

Startup logs

In OutputLogs/ds3output0.txt (installed package), confirm Container pool engine ready for the matching pool, Container pool warmed for the warm containers, and that the ChromeContainerized profile is loaded. A configured pool for the other engine OS being hidden is expected (e.g. the Windows pool on a Linux engine).

Proxy and pool connectivity

curl -i --max-time 5 http://127.0.0.1:9090/          # any HTTP response (even 404) = proxy listening
docker ps --filter 'label=appvance.ds.container-pool=chrome-linux'
docker exec <container-id> python3 /opt/appvance/browser-supervisor.py status        # warm containers: idle
docker exec <container-id> python3 /opt/appvance/browser-supervisor.py probe-proxy host.docker.internal 9090   # must print: reachable

On Linux / Windows Server use your dsProxyHost (bridge or NAT gateway) instead of host.docker.internal. The commands use Linux image paths; adjust for the Windows image.

Lease, cleanup and reuse

  1. Select ChromeContainerized, start a session, navigate to a simple page. The leased container's status must start with running:.
  2. Stop the session; the container returns to idle.
  3. Start a replacement session and navigate again — this proves cleanup and reuse, not just first launch.

For concurrency testing, keep one or two spare pool slots and replace sessions in small batches (start replacements first, then stop the old ones) to avoid pool exhaustion. Use bounded navigation retries for external sites and record session readiness separately from page success.

macOS packaged verifier (verify-macos.sh)

Shipped in the release bundle; it does not change AIQ configuration. It creates one disposable container with DSServer's settings, checks both network directions, and removes it on exit.

cd <container-browser-bundle>
chmod +x verify-macos.sh
./verify-macos.sh --aiq-install <AIQ-install>                         # infrastructure checks
./verify-macos.sh --aiq-install <AIQ-install> --observe-session 180   # start ChromeContainerized from the UI when prompted
./verify-macos.sh --aiq-install <AIQ-install> --mcp                   # only if loopback MCP is already enabled
AIQ_MCP_TOKEN='<token>' ./verify-macos.sh --aiq-install <AIQ-install> --mcp   # bearer token kept off the command line

Observed-session checks walk the full route: container → host.docker.internal:9090; Chrome launched with --proxy-server; Chrome CDP on 9223 inside the container; supervisor relay on 9222; 9222 published to a dynamic host-loopback port; host reaches /json/version through it. The script never enables MCP or edits mcp.json.

Troubleshooting

Session closes unexpectedly

First verifier failure → likely fault

First failure

Likely fault

DSServer proxy is not accepting host connections

Proxy disabled, not listening, or on a different port.

container cannot reach DSServer proxy

Docker can't route dsProxyHost to the proxy, or a firewall is blocking it.

Chrome CDP does not respond ... 9223

Chrome failed or exited inside the image.

container CDP relay does not respond ... 9222

Supervisor/relay missing, incompatible, or failed.

Docker did not publish ... 9222

Pool container created without the dynamic loopback mapping, or AIQ is using a different Docker context.

host cannot reach Chrome CDP through the published port

Docker Desktop host-loopback forwarding failed or was blocked.

If every route check passes but sessions still close, compare the installed DSServer and container-browser bundle versions and inspect the lifecycle errors from OutputLogs. Send support the full verifier output starting at the first FAIL line.

GPU process launch failed: error_code=1002 (macOS)

Emitted after Chrome starts when a GPU child-process launch fails. It is not a DSServer proxy error. On Apple Silicon, first check the amd64 emulation path:

cd <container-browser-bundle>
./diagnose-macos-gpu.sh --aiq-install <AIQ-install> > macos-gpu-diagnostic.txt 2>&1

The redacted report records host, Docker Desktop version, virtualization backend, Rosetta status, context, engine resources, image identity, Chrome version, and a three-mode Chrome launch matrix. Attach it with the verify-macos.sh output.

{"name": "disable-gpu", "value": "true"},
{"name": "experimentalDS3", "value": "--disable-software-rasterizer"}

Reference working Apple Silicon host (comparison values, not minimums)

Other common issues

Symptom

Likely cause / fix

ChromeContainerized profile missing

Docker unreachable at startup, wrong context, or pool OS doesn't match engine mode. Check docker context show, fix config, restart DSServer.

POOL_EXHAUSTED on session start

All leases busy for the full retry window (~20 s default). Increase pool size (if memory allows) or retry settings; keep spare slots during batch replacement.

Windows build fails downloading Chrome/Python

--build-arg BUILD_DNS=<working-DNS-IP>.

Windows container won't start with process isolation

Host build incompatible with ltsc2025 — check Microsoft's matrix, or switch build flag and runtime.isolation to hyperv.

Windows containers unavailable on Windows 11

Docker Desktop installed per-user, or Home edition. Reinstall for all users on Pro/Enterprise.

DSServer can't run Docker on Windows 11

Service account not in docker-users (sign out/in after adding).

Config rejected for TCP endpoint

tls CA/cert/key paths missing.

Config rejected for acquire settings

acquireTimeoutMs combined with the retry settings — use one style.

Containers disappear when another server starts

Two DSServer deployments share an ownerId.

Production checklist (not yet complete)

Pin an approved image digest; set allowUnpinnedImage to false

Size the pool for host memory and CPU

Unique, stable ownerId per deployment

Docker daemon access restricted to the DSServer account and trusted operators

Proxy firewall rules limited to the Docker private subnet; CDP never public; mTLS and a private CDP route for any remote Docker host

Release-matched container-browser bundle for installed packages

Acceptance checklist in the implementation progress log complete

References