PBX Browser Automation

A normal-user-friendly guide to creating, testing, configuring and running browser automations with the PBX Browser Script Builder.

Advertisement

Getting Started

PBX Browser Automation lets you build browser tasks by arranging commands in a visual Script Builder. You do not need to write the internal automation engine code yourself.

1. Build

Create a script and add the commands you need.

2. Configure

Fill the fields shown for each command.

3. Test

Test important commands before building a larger workflow.

4. Run

Start the finished automation from the Automation interface.

Current command system: The current picker includes normal browser commands plus control commands for variables, page-load waiting, conditions, loops and functions. Native touch and swipe commands are also available.

Test Commands Before Building the Full Script

Use the Interactive Command Test Lab to test selectors, values, variables, flow control and HTTP requests before adding the same logic to your final automation.

Open Interactive Command Test Lab

Create a Script

  1. Open Script Builder.
  2. Create a new automation script.
  3. Add the commands required for your task.
  4. Fill the required fields.
  5. Arrange the commands in execution order.
  6. Test the important commands.
  7. Start the automation from the Automation interface.
Example: Open a website and read a value
Navigate → Wait Page Load → Wait For Element → Get Text

In simple terms: open the website, wait for loading, wait for the target element, then read its text.

Import a Script

  1. Open the Automation interface.
  2. Choose Import.
  3. Select the supported script package.
  4. Review the installed script before running it.
Example

Import login-flow.pbx, review its commands and settings, then enable it when you are ready to test it.

Export a Script

Export an installed automation when you want a backup, transfer the script to another installation, or share the script package.

  1. Open the Automation interface.
  2. Find the script.
  3. Select Export.
  4. Save the generated package.

Marketplace

Automation scripts can also be installed through the PBX Browser marketplace.

Open PBX Browser Marketplace

  1. Open the marketplace.
  2. Find the required automation.
  3. Download the script package.
  4. Install/import it in PBX Browser.
  5. Review its configuration.
  6. Enable and run it.
Marketplace scripts: The current project documentation describes marketplace-downloaded scripts as installable and executable rather than directly editable by the user.

Script Builder & Command Editor

The Script Builder is the visual editor where commands are added, configured and arranged.

Add

Choose a command from the command picker.

Edit

Change the fields shown by that command.

Order

Commands execute in the order defined by the script.

Flow

Conditions, loops and functions control how commands are reached and repeated.

Important: Not every command has the same fields. Some commands return useful data, some only perform an action, and structural commands control execution flow.

Add a Command

  1. Open the script in Script Builder.
  2. Select Add Command.
  3. Search for the command or browse its category.
  4. Select the command.
  5. Fill the required fields.
  6. Configure optional fields when needed.
  7. Place the command in the correct execution position.
Example: Wait for a login button

Add Wait For Element.

Selector: #login

Timeout: 30000 milliseconds.

The automation waits until the element appears or the timeout is reached.

Delete a Command

  1. Select the command.
  2. Use the delete/remove control.
  3. Check the surrounding flow after deleting it.
Be careful when deleting structural commands. If a condition, loop or function is no longer correctly paired, the automation flow can change.

Command Fields

Field Meaning Example
Selector CSS selector identifying a webpage element. #login
URL Destination webpage or network endpoint. https://example.com
Text Text entered into an element or keyboard path. Hello
Value Command-specific value. premium
Timeout Maximum wait time for commands that support it. 30000 ms
Variable Optional destination for useful result data when result capture is supported. accountName
Condition Rule used by conditional commands. ${status} == ready
Function Name Name of a reusable function. login
Script Name Name of another automation used by Connect Script. login_helper

Variables & Results

Commands can finish with a runtime result. When the result contains useful information, the command can expose that information for later automation steps when result capture is supported.

Result Variable

Stores useful data returned by a command.

Example: Get Text → username

Set Variable

Creates or updates the variable itself. It does not need a generic result-variable field.

Example: server_url = https://example.com/api

Command-Specific Results

Result data can be text, Boolean, structured data or another value defined by the command.

Example: Read an account name

Add Get Text.

Selector: .account-name

Variable: accountName

The saved value can be used later wherever variable resolution is supported.

Advertisement

Script Manifest

The manifest contains script-level information and configuration used by the automation runtime.

What it can control

  • Script-level configuration.
  • Developer information.
  • Login/authentication configuration.
  • Information used by the script session.
Configure the manifest through the PBX Browser editor. Keep raw manifest fields synchronized with the current application model rather than inventing undocumented JSON fields.

Script Login & Signup

Login is handled by the automation runtime when authentication is required. It is not a normal browser command.

Login Required

The runtime can pause normal execution while login information is presented.

Login Success

The automation can continue after successful authentication.

Login Failure

Failure information can contain a message and related error details.

Script Sessions

A main automation script owns its runtime session. Connected scripts use the active main-script session.

This keeps connected script execution associated with the same main automation session.

Connected Scripts

Connect Script lets one automation reuse another automation script.

Example: Reuse a login helper

Create a reusable script named login_helper.

In another automation, add Connect Script and select login_helper.

The connected script runs as part of the current workflow.

Automation Runtime Lifecycle

You normally do not need to manage these internal steps. This simplified view explains what happens when an automation starts.

Manifest → Session → Authentication → Variables → Execution State → Commands → Results
Execution model: Commands execute in script order. Control commands manage branching/repetition. Each executable action produces an AutomationResult state.

Automation Results

The current runtime uses a result model with Success, Failure and Running states.

State Meaning Typical data
Success The command completed successfully. String, Boolean, structured object/map, or command-specific data.
Failure The command could not complete successfully. Message and optional cause.
Running Execution is still active. No final result yet.
Example: What a successful command means

A navigation command can finish with a Success result and command-specific data.

If navigation fails or times out, the runtime returns Failure with an explanation.

Loop Runtime

Loop Start and Loop End define a repeatable block. The commands between them are executed according to the configured loop count.

Example: Refresh a page five times
Loop Start · 5 → Refresh → Wait Page Load → Loop End
Keep Loop Start and Loop End correctly paired. Nested loops must also remain structurally balanced.

Touch Events Commands

Touch Element Touch Events

Performs a native Android touch on a selected webpage element.

Fields: Selector: #submit
Timeout: 30000 ms (optional)

Test example

Use #submit when you want to test a native touch on the page's Submit button.

Result: Native touch execution data when provided by the current implementation.

Swipe Up Touch Events

Performs a native upward swipe.

Fields: Duration: optional, default 400 ms

Test example

Use Swipe Up to move down a long webpage before checking another element.

Result: Swipe execution status.

Swipe Down Touch Events

Performs a native downward swipe.

Fields: Duration: optional, default 400 ms

Test example

Use Swipe Down to return toward the top of a webpage.

Result: Swipe execution status.

Swipe Left Touch Events

Performs a native left swipe.

Fields: Duration: optional, default 400 ms

Test example

Use Swipe Left on a horizontally scrollable area.

Result: Swipe execution status.

Swipe Right Touch Events

Performs a native right swipe.

Fields: Duration: optional, default 400 ms

Test example

Use Swipe Right on a horizontally scrollable area.

Result: Swipe execution status.

Interaction Commands

Click Interaction

Clicks a webpage element.

Fields: Selector: required
Timeout: optional, default 30000 ms

Test example

Selector: #login-button

Result: Success/failure. Return data type: true, false, no_element

Type Interaction

Types text into a selected webpage element.

Fields: Selector: required
Text: required
Timeout: optional

Test example

Selector: input[name="email"]
Text: user@example.com

Result: Typing success/failure. Return data type: true, false, no_element

Clear Interaction

Clears the value from an input element.

Fields: Selector: required

Test example

Selector: #search

Result: Success/failure. Return data type: true, false, no_element

Focus Interaction

Places focus on a webpage element.

Fields: Selector: required

Test example

Selector: input[name="email"]

Result: Success/failure. Return data type: true, false, no_element

Keyboard Type Interaction

Sends text through the Android keyboard input path.

Fields: Text: required

Test example

Text: Hello PBX Browser

Result: Typed text/status result. Return data type: true, false, no_element

Key Press Interaction

Presses a supported keyboard key or key combination.

Fields: Key: required

Test example

Try ENTER, TAB, ESC or CTRL+A.

Result: Key press success/failure. Return data type: true, false, no_element

Double Click Interaction

Performs two clicks on an element.

Fields: Selector: required
Interval: optional, default 100 ms

Test example

Selector: .file-row

Result: Success/failure. Return data type: true, false, no_element

Long Press Interaction

Presses and holds an element for the configured duration.

Fields: Selector: required
Duration: optional, default 1000 ms

Test example

Selector: .menu-item
Duration: 1000 ms

Result: Success/failure. Return data type: true, false, no_element

Right Click Interaction

Performs a right-click interaction on an element.

Fields: Selector: required

Test example

Selector: .context-menu-target

Result: Interaction success/failure. Return data type: true, false, no_element

Hover Interaction

Moves the pointer over an element.

Fields: Selector: required

Test example

Selector: .products-menu

Result: Success/failure. Return data type: true, false, no_element

Drag Interaction

Drags one webpage element toward another element.

Fields: Source Selector: required
Target Selector: required

Test example

Source: .card
Target: .drop-zone

Result: Success/failure. Return data type: true, false, no_element

Scroll Interaction

Scrolls the page or a selected scrollable element.

Fields: Selector: optional
X: optional, default 0
Y: optional, current default 500

Test example

Page scroll: X 0, Y 600.

Result: Scroll success/failure. Return data type: true, false, no_element

Select Interaction

Selects an option from an HTML select control.

Fields: Selector: required
Value: required

Test example

Selector: #country
Value: india

Result: Selected value/status result. Return data type: true, false, no_element, no_value

Elements Commands

Find Element Elements

Searches for an element using a CSS selector.

Fields: Selector: required
Timeout: optional, default 30000 ms

Test example

Selector: #login-button

Result: Success when found; Failure when not found.

Exists Elements

Checks whether an element exists in the page DOM.

Fields: Selector: required
Timeout: optional
Variable: optional result capture

Test example

Selector: .success-message
Variable: successExists

Result: Boolean/result data depending on the command result.

Is Visible Elements

Checks whether an element exists and is visible in the current viewport.

Fields: Selector: required
Timeout: optional
Variable: optional result capture

Test example

Selector: #submit
Variable: submitVisible

Result: Visibility result/status.

Get Element Location Elements

Reads the selected element's position and size.

Fields: Selector: required

Test example

Selector: .product-card

Result: Structured location data can include position, size, center values and device-pixel-ratio information.

Scroll Into View Elements

Scrolls a selected element into the visible viewport.

Fields: Selector: required
Center: optional

Test example

Selector: #checkout
Center: enabled

Result: Success/failure.

Wait For Element Elements

Waits until an element appears in the page DOM.

Fields: Selector: required
Timeout: optional, default 30000 ms
Interval: optional, default 250 ms

Test example

Selector: #dashboard
Timeout: 30000 ms

Result: Success when found; Failure after timeout.

Get Text Elements

Reads text from a selected element.

Fields: Selector: required
Variable: optional result capture

Test example

Selector: .account-name
Variable: accountName

Result: Text string.

Get HTML Elements

Returns the selected element's HTML.

Fields: Selector: required
Variable: optional result capture

Test example

Selector: #profile
Variable: profileHtml

Result: HTML string.

Get Attribute Elements

Reads an attribute from an element.

Fields: Selector: required
Attribute Name: required
Variable: optional

Test example

Selector: a.download
Name: href
Variable: downloadUrl

Result: Attribute value or nullable value.

Set Attribute Elements

Changes an attribute on the selected element.

Fields: Selector: required
Attribute Name: required
Value: required

Test example

Selector: #button
Name: data-state
Value: ready

Result: Success/failure.

JavaScript Commands

Execute JavaScript JavaScript

Executes JavaScript in the current webpage.

Fields: JavaScript: required

Test example

Try document.title or document.querySelector("#status")?.innerText.

Result: The value returned by the JavaScript expression, when one is returned.

Dispatch JavaScript Event JavaScript

Sends a JavaScript event to a selected element.

Fields: Selector: required
Event: required

Test example

Selector: #email
Event: input

Result: Event dispatch success/failure.

Control Commands

Sleep Control

Pauses automation for a specified duration.

Fields: Duration: required, milliseconds

Test example

Duration 1000 = 1 second.
5 * 1000 = 5 seconds.

Result: Sleep completed.

Set Variable Control

Creates or updates an automation variable.

Fields: Variable Name: required
Value: optional

Test example

Variable Name: server_url
Value: https://example.com/api

Result: The command defines the variable itself; it does not need a generic result-variable field.

Wait Page Load Control

Waits for the current page to report that it has completely loaded.

Fields: Timeout: optional, default 30000 ms

Test example

Navigate to a page, then use Wait Page Load before reading important page content.

Result: Success when complete; Failure on timeout/evaluation error.

Network Commands

HTTP Request Network

Sends an HTTP request from the automation runtime.

Fields: Method: required
URL: required
Action: required
Data: optional
Headers: optional

Test example

Method: POST
URL: https://example.com/api.php
Action: task_request

Result: HTTP response data/status exposed by the current command implementation.

Report Network

Sends a report to a configured endpoint.

Fields: URL: required
Action: required
Data: optional
Headers: optional

Test example

URL: https://example.com/report.php
Action: automation_complete

Result: Report execution success/failure.

Script Commands

Connect Script Script

Runs another automation script as part of the current workflow.

Fields: Script Name: required

Test example

Script Name: login_helper

Result: Structured information from the connected script when exposed by the runtime.

Conditions Commands

If Conditions

Starts a conditional block.

Fields: Condition: required

Test example

Condition: ${login_found} == true

Result: Control-flow result; not normal result data.

Else If Conditions

Adds another condition to the active conditional block.

Fields: Condition: required

Test example

Check another status when the first condition is false.

Result: Control-flow result.

Else Conditions

Defines the fallback branch of an If block.

Fields: No fields.

Test example

If login succeeds use the success branch; otherwise use Else for the failure path.

Result: Control-flow result.

End If Conditions

Closes the active conditional block.

Fields: No fields.

Test example

Place End If after the final branch commands.

Result: Control-flow marker.

Loops Commands

Loop Start Loops

Starts a block that should be repeated.

Fields: Repeat Count: required

Test example

Repeat Count: 5
Put the commands to repeat between Loop Start and Loop End.

Result: Control-flow result.

Loop End Loops

Closes the active loop block.

Fields: No fields.

Test example

Place Loop End after the last command that should repeat.

Result: Control-flow result.

Functions Commands

Function Start Functions

Starts a reusable function definition.

Fields: Function Name: required

Test example

Function Name: login

Result: Function control result.

Function End Functions

Closes a function definition.

Fields: No fields.

Test example

Place Function End after the final command inside the function.

Result: Function control result.

Call Function Functions

Executes an existing reusable function.

Fields: Function Name: required

Test example

Function Name: login

Result: Function execution result/status.

Documentation Notes

Examples: Every command reference includes a simple test example so a normal user can understand what to enter and what the command is expected to do.
Result handling: Do not assume every command returns a raw Boolean. The runtime result is command-specific. Action commands can return status/data, result-producing commands can return useful values, and structural commands control execution flow.
Maintenance: When a command is added, removed, renamed, or its fields change, update this documentation together with the command registry and Script Builder.