Script Statistics in BAS
The Script Statistics module in Browser Automation Studio — read the thread number and success/failure counts to drive logic and monitor a running bot.
A running BAS project knows things about itself — which thread is executing, how many runs have worked, how many have failed. The Script Statistics module exposes those numbers so your bot can react to them.
What it reports
The module is used to read statistical indicators of the script’s work:
- Thread number — the number of the thread currently executing.
- Successful executions — how many runs have completed as a success.
- Unsuccessful executions — how many have failed.
These pair with the success/fail verdicts from the Script Logic module — logic sets the outcome, statistics counts it.
The most useful trick: per-thread logic
The standout use is running a scenario only in specific threads. Say you want a step to happen only in threads 2 and 4 — read the thread number and gate it with an IF that matches those numbers. This lets one project behave differently across its parallel workers: some threads do one job, others do another, all from the same flow.
Why it matters
Most bots run many threads at once, and sometimes uniform behaviour isn’t what you want — you need a few threads on a different task, or you want to watch the success rate and stop when failures climb. Script Statistics is the small module that makes a multi-threaded run aware of itself, turning raw parallelism into something you can steer.
FAQ
How do I run logic in a specific thread in BAS?
Read the thread number with the Script Statistics module and branch on it with an IF. For example, to act only in threads 2 and 4, check the thread number and run that branch when it matches.
Can BAS report how many runs succeeded or failed?
Yes. The Script Statistics module exposes the count of successful and unsuccessful executions while the script runs, so you can monitor progress and branch on the numbers.
- Browser Automation Studio: The Complete Practical GuideGuide
- Building Your First Bot in Browser Automation StudioA step-by-step walkthrough of creating your first working BAS bot — from a blank project to a flow that navigates, extracts data, and runs in multiple threads.
- Setting Up Proxies in Browser Automation StudioHow to configure proxies in BAS the right way — proxy types, per-thread assignment, rotation, and the checks that keep multi-account bots from getting flagged.
- Finding Elements in BAS: Selectors That Don't BreakHow element search works in Browser Automation Studio — CSS vs XPath selectors, why recorded ones break, and how to write selectors that survive page changes.