BAS Errors: Why Your Bot Fails and How to Debug It
A walkthrough of the common Browser Automation Studio failures - element not found, browser will not start, proxy not responding, script hanging - plus a practical debugging setup: logs, failure screenshots, retries and per-action error handling.
All articles in the guide Browser Automation Studio · 48
A BAS bot almost never breaks “on its own”. It breaks where reality diverged from expectation: the page arrived slower, the markup changed, the proxy died. Debugging is mostly the skill of finding out quickly where that happened.
Element not found
The most common error, and the most commonly misdiagnosed. There are exactly three causes, and they need different fixes.
The element is not there yet. The script reached the check before the page finished rendering - normal for anything loaded dynamically. The fix is not a longer pause but waiting on the element itself: a fixed pause either wastes time or turns out to be too short one day.
The selector is brittle. It is pinned to a class like css-1x7f9a generated by a bundler, and that class changes on every deploy. Anchor to things that carry meaning instead: text, attributes, structure. More in the guide to selectors that do not break.
The element is in another context. It sits inside an iframe or another tab while the bot searches the current document. It is on screen, but as far as the script is concerned it does not exist.
The browser will not start
When a thread dies immediately at launch, check in this order:
- Memory. The usual cause is more threads than the machine can hold - the browser cannot start because there is no RAM left. Lower the thread count and see whether the error disappears.
- First run after compiling. A compiled bot needs to download its environment, and without internet it will not start.
- Antivirus. An automation app that fetches components is a textbook blocking candidate.
- Leftovers from earlier runs. Orphaned browser processes from crashed threads hold memory and get in the way of new ones.
Proxy not responding
Proxy errors are treacherous because they wear other errors’ clothing. The bot reports “page did not load” or “element not found” when the real cause is a dead address.
The tell: failures are tied to a thread, not to a step. If thread 4 always dies while the others run fine, its proxy is almost certainly the reason. Which argues for testing proxies before the run rather than inferring their health from crooked symptoms mid-scenario.
The script hangs
A hang differs from a crash: the bot reports nothing, it simply stands still. The cause is always the same - waiting on an event that will not arrive:
- waiting for an element that will not appear on this page;
- waiting for a load that finished before the wait started;
- waiting for an email code that is never sent.
The fix is structural: every wait needs a finite timeout. A bot that fails in a minute with a clear message is incomparably better than one that ties up a thread for a day and poisons your statistics.
Works in the studio, fails in production
A classic with three sources. First, speed: in the studio you watch the bot and unconsciously give it time, while at ten threads pages load slower. Second, paths: relative and absolute diverge after compiling. Third, state: in the studio you run against an already logged-in profile, while production starts from zero.
The test is simple: run on a clean profile at full thread count. Most “inexplicable” divergences surface immediately.
A debugging setup
Debug from evidence, not from guesses. The minimum kit, which pays for itself on the first incident:
Log steps, not the fact of failure. A line saying “error” is useless. A line saying “thread 4, account ivan@mail, step Login, submit button not found” is nearly a diagnosis. Write to a file through the tools module, not just to the screen - you will not be watching the screen when the bot runs at a client site.
Screenshot on failure. One image answers in a second what otherwise costs an hour: whether there was a captcha, a redirect, a consent banner or a blank page. It is the cheapest diagnostic tool in automation.
Save the HTML on failed steps. When a selector stops matching, the only way to understand why is to see the markup that was actually there.
Count failures by type. Separate “element not found” from “proxy died” from “captcha” - different problems with different fixes. An aggregate “40% failure rate” tells you nothing; statistics broken down by cause tell you what to repair.
Retries instead of crashes
Some errors do not warrant stopping - they are transient: the network blinked, a page came slower than usual, a proxy hesitated. Those steps deserve a retry rather than taking down the whole thread.
The dividing rule is simple. Retry network failures and load timeouts - things that may well pass on the next attempt. Do not retry wrong credentials, a missing account, or an exhausted quota: retrying there only burns time and brings a ban closer.
And separately: a retry without a limit is a hidden infinite loop. Always cap the number of attempts.
FAQ
What do I do when BAS says the element was not found?
Nine times out of ten the element exists but had not appeared yet when the check ran. Replace the fixed pause with a wait on the element itself first; only if that fails should you inspect the selector - it may be pinned to a generated class that changes on every load, or the element may live inside an iframe.
Why does my script hang instead of moving on?
A hang is almost always a wait for something that will never happen: an element that will not appear, or a load that already finished before the wait began. Give every wait a finite timeout - a bot that fails in a minute with a clear message beats a bot that holds a thread for a day.
- 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.
Done for you
Rather not build it yourself? I will build a BAS bot for your task
Multithreading, proxies, antidetect profiles and scheduled runs. The whole project and every access stay with you.
from $300 · 3 to 7 days
"Pavel is a great specialist, he delivered the parser in a few hours. I will keep ordering from him. Huge thanks for the professionalism and the speed."