How unit 4 is examined
This unit covers attended (assistant) bots that react to user events through triggers, and then debugging and exception handling. No topic was asked in the supplied papers, so every topic is short but complete.
What are assistant bots
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>An assistant bot is an attended bot that runs on the user's own desktop, works alongside the user and is started by the user or by a user event.</mark>
Key points.
- Assistant bots are attended automation: they need a human present, unlike unattended bots that run on a server.
- They are launched on demand, by a button, a hotkey, a mouse action or a system event.
- They automate repetitive parts of a task, such as copying data between windows, while the user does the judgement work.
- They run inside the user's logged-in session, so they use the user's screen, keyboard and permissions.
Pitfall: Do not call an assistant bot unattended; it always works with a person at the desk.
Monitoring system event triggers
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>A trigger is a condition the bot watches continuously; when the event occurs, the bot starts a workflow automatically.</mark>
Key points.
- A monitoring (event-trigger) workflow has two parts: the trigger that waits for an event and the action that runs when it fires.
- The bot keeps monitoring in the background, so the user does not start it manually each time.
- Trigger types are hotkey, mouse, keyboard, system, image and element triggers.
- Each firing passes event details, such as the key pressed or the click position, to the action.
- Monitoring must be stopped or the workflow ended, otherwise the trigger keeps listening.
Hotkey trigger
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>A hotkey trigger fires when the user presses a chosen key combination, such as Ctrl+Shift+K, and runs the linked workflow.</mark>
Key points.
- The hotkey is configured as a key plus modifiers (Ctrl, Alt, Shift, Win).
- It works even when another application is in focus, so the user can start the bot from anywhere.
- It should avoid combinations already used by the operating system or applications, such as Ctrl+C.
- It gives a quick, button-free way to start an assistant bot for one repeated task.
Mouse trigger
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>A mouse trigger fires when a chosen mouse event, such as a left click, right click or double click, happens, optionally with a key held down.</mark>
Key points.
- The trigger is set to a mouse button and the click type (single or double).
- A modifier key such as Ctrl can be added so ordinary clicks do not fire it.
- It suits actions like Ctrl+click on a cell to look up the value in another system.
- The event can also report the click position, which the action can use.
System trigger
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>A system trigger fires on an operating-system level event, such as a keystroke, a mouse action or a window or application change, rather than on one specific hotkey.</mark>
Key points.
- It is a general-purpose trigger that watches system events like key press, click, or an application opening.
- The trigger can be scoped to one application or window so it does not fire elsewhere.
- It differs from the hotkey trigger, which is limited to one chosen key combination.
- When fired, the bot runs the action and then goes back to waiting for the next event.
Monitoring image and element triggers
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>An image trigger fires when a chosen image appears on the screen; an element trigger fires when a chosen UI element appears, disappears or changes.</mark>
Key points.
- The image trigger matches a picture (icon, logo, button) against the screen using image recognition.
- The element trigger identifies a UI element through its selector, so it is more reliable than an image.
- Both are used to react to things like a pop-up appearing or a status field changing.
- Image matching is sensitive to resolution, scaling and colour, so it is the fallback when no selector exists.
Launching an assistant bot on a keyboard event
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>Launching on a keyboard event means a key press or hotkey starts the assistant bot's workflow without the user opening the tool.</mark>
Steps.
Step 1: Add a monitoring trigger (hotkey or key-press) to the workflow.
Step 2: Set the key and modifiers that should start the bot.
Step 3: Place the automation steps in the action that runs on the event.
Step 4: Publish and start the assistant so it listens in the background.
Step 5: Press the hotkey; the bot runs, then waits for the next press.
Key points.
- The keyboard event is the launch condition, so no button or menu is needed.
- The chosen key must be unique so it does not clash with other shortcuts.
- The bot must already be running and listening for the key to be recognised.
Debugging and Exception Handling
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>Debugging is finding and fixing faults in a workflow; exception handling is preparing the workflow to deal with runtime errors without crashing.</mark>
Key points.
- Debugging happens during development, exception handling is built into the workflow for run time.
- Common faults are wrong selectors, missing files, null values, timeouts and changed screens.
- Without handling, an error stops the whole process and leaves work half done.
- Good handling logs the error, recovers or retries, and reports clearly.
Debugging Tools
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>Debugging tools let the developer run a workflow step by step and inspect its state to locate a fault.</mark>
Key points.
- A breakpoint pauses the run at a chosen activity so the state can be examined.
- Step into, step over and step out execute one activity at a time, with or without entering an invoked workflow.
- The Locals or variables panel shows current values of variables and arguments, and the Output panel shows log messages.
- Highlight elements and slow step show which UI element an activity is acting on.
Strategies for solving issues
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>A troubleshooting strategy is a systematic way to reproduce an error, find its cause and fix it without breaking other parts.</mark>
Key points.
- Read the error message and log first, as they usually name the failing activity.
- Reproduce the issue, then isolate it by breakpoints or by running smaller parts of the workflow.
- Check the usual causes: selectors, variable values, timing and application state.
- Add logging, retries and waits, then retest the full flow.
Catching errors
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. <mark>Catching errors means placing risky activities inside a Try Catch block so that an exception is caught and handled instead of stopping the bot.</mark>
Key points.
- Try Catch has three sections: Try holds the activities that may fail, Catches handles the exception, and Finally runs always.
- Each catch names an exception type, such as a business or system exception, so different errors get different handling.
- Inside a catch the bot can log the error, take a screenshot, retry or rethrow.
- Finally is used for cleanup such as closing applications, whether or not an error occurred.
Step 1: Try: run the risky activities.
Step 2: If an exception occurs, jump to the matching Catch.
Step 3: Catch: log, screenshot, retry or rethrow.
Step 4: Finally: clean up and close applications.
Last-minute revision
- An assistant bot is an attended bot on the user's desktop, started by the user or an event.
- A trigger has a monitored event and an action that runs when it fires.
- Trigger types: hotkey, mouse, keyboard, system, image and element.
- A hotkey is a key plus modifiers and works from any application.
- A mouse trigger uses a button, click type and optional modifier key.
- An element trigger uses a selector and is more reliable than an image trigger.
- Debugging finds faults at development time; exception handling copes with errors at run time.
- Breakpoints pause the run; step into, over and out move one activity at a time.
- Try Catch has Try, Catches and Finally sections.
- Finally always runs, so it is used for cleanup.
Memory hooks
- ATTENDED = Assistant needs a person; the bot works at your side.
- Trigger = Watch, then Act.
- HMSIE: Hotkey, Mouse, System, Image, Element triggers.
- Debug = Break, Step, Watch (breakpoint, step, variables panel).
- Try, Catch, Finally = attempt, rescue, clean up.
Coverage checklist
- What are assistant bots: definition and attended nature (no past questions).
- Monitoring system event triggers: trigger and action model (no past questions).
- Hotkey trigger: key combination trigger (no past questions).
- Mouse trigger: click event trigger (no past questions).
- System trigger: OS-level event trigger (no past questions).
- Monitoring image and element triggers: image and element triggers (no past questions).
- Launching an assistant bot on a keyboard event: steps to launch by key press (no past questions).
- Debugging and Exception Handling: debugging vs exception handling (no past questions).
- Debugging Tools: breakpoints, stepping, panels (no past questions).
- Strategies for solving issues: troubleshooting steps (no past questions).
- Catching errors: Try Catch Finally (no past questions).