RPA describes automating a repeatable business process. Many RPA tools offer a visual editor and some include a recorder. For example, Power Automate for desktop turns recorded interactions with web and desktop elements into editable flow actions. A recording captures one route through the interface. Supply variables for changing values, define branch conditions, and add checks for unexpected pages or missing results. Microsoft Power Automate recorder documentation
Browser scripting controls a browser in code. In a Playwright test, a locator specifies the element to operate on and an assertion checks the resulting page state. The team can keep the script, fixtures, and code review in its release repository. The approaches overlap. A visual RPA flow can operate a browser, and a browser script can automate a step inside a wider RPA process.
Start with the team that will own changes and failures. Evaluate the required behavior, execution environment, and evidence needed to accept each run.
| Decision | Visual RPA flow | Browser scripting |
|---|---|---|
| Best starting point | A stable, authorized UI sequence such as exporting a portal report | A staging regression check or web task needing custom validation |
| Building and review | Edit actions, variables, and branches in a builder. Confirm who can review and publish changes | Review selectors, assertions, fixture changes, and dependencies in version control |
| Success condition | Add a check of account, date, or output to the flow | Assert the rendered or stored outcome and fail the test when it differs |
| Handling breakage | Inspect the failed action and retest updated selectors with sample inputs | Reproduce the failing scenario with trace and fixtures. Update the locator or fix the application |
| Operational ownership | Verify scheduling, runtime access, history, and who can pause the job | Assign an owner for the runner, browser upgrades, secrets, and alerts |
For structured updates across systems, start with a supported API when it covers the operation. Preserve a business key such as the source record ID for any write whose response might be lost. Check the existing outcome before resubmitting. If you cannot establish whether the write succeeded, hand the case to a person for reconciliation.
A release check should verify what a user can see. Seed staging with one available item and one unavailable item. After applying the filter, check the count and both rows. Using an accessible control name makes the test follow the UI the user interacts with, and Playwright's assertions wait for the resulting state up to their configured timeout. Playwright testing best practices
Save this as stock.spec.ts in a Playwright Test project. Set QA_STOCK_URL to your approved, seeded page with the same labels, or serve an equivalent fixture at the loopback URL in the example. The example was run against a local synthetic page in Chromium. It passed with a working filter and failed when the filter left the unavailable row visible. Use your own staging URL and expected labels for real coverage.
import { expect, test } from '@playwright/test';
test('shows only available stock after filtering', async ({ page }) => {
await page.goto(
process.env.QA_STOCK_URL ?? 'http://127.0.0.1:4173/stock',
);
await page.getByRole('button', { name: 'Show in-stock items' }).click();
await expect(page.getByRole('status')).toHaveText('1 item in stock');
await expect(page.getByRole('row', { name: /Demo mug/ })).toBeVisible();
await expect(page.getByRole('row', { name: /Demo plate/ })).toHaveCount(0);
});
Keep the data fixture separate from the assertion. For release failures, capture a trace under the job ID so an engineer can locate the failing action and inspect page snapshots. Restrict artifact access when a trace may contain application data. Playwright Trace Viewer
Use a visual flow for the approved portal export when the operations team owns the task and the report format is stable. Give it a read-only account, a date input, and a destination. Record the navigation, filter, and export actions if your builder includes a recorder. Add a check for the account and displayed date before exporting, and wait until the file is ready before validating it. In a scripted version, Playwright documents registering the download listener before clicking and saving the file before its browser context closes. Playwright download handling
Save to a temporary location and inspect the results before promoting the file. For a daily inventory report, confirm the expected headers, account and reporting date, then apply a business rule for empty results. An explicit zero-results state can be legitimate. An HTML sign-in page downloaded with a CSV filename should fail validation. Publish the report to its final path under an account-and-date key so a retry can detect that the day's report already exists.
The Nstbrowser RPA documentation describes workflow editing, detailed logs, and scheduled runs. This route fits a team testing a predictable sequence of authorized UI steps in a named browser environment. Build a read-only task for an approved test account and run it once before adding a schedule. Define the expected output and who reviews exceptions. The Nstbrowser Marketplace guide shows how to add and edit a template.
Teams that maintain their own scripts can evaluate the documented Playwright integration for Nstbrowser Client and Docker. Use the Profile lifecycle guide to plan profile selection, browser connection, and cleanup. Keep the browser lifecycle separate from the assertions or report checks in your code. Verify this deployment against your own authorized test Profile before using it for scheduled work.
Start with one staging smoke test or read-only export. Choose a visual flow when the operations owner can update it and verify its output. Choose a script when maintaining assertions and fixtures in the release repository is part of the job. Before scheduling either option, capture one valid result and one expected failure and have a second operator explain both from the run record.
Q: What is the difference between RPA and browser scripting?
Robotic process automation describes automating a business process, often with a visual builder and sometimes across web and desktop applications. Browser scripting describes controlling a browser in code. A visual RPA flow and a browser script can both automate one approved web task. Evaluate how each will be changed, reviewed, scheduled, and recovered.
Q: Should I use browser automation or an API?
Use a supported API when it covers the required data or operation. Use a browser when the rendered user experience matters or an authorized operation is only available through the interface. A workflow can use an API to prepare data and a browser to verify the result.
Q: How do I make browser automation more reliable?
Use stable locators, predictable test data, explicit checks, and a run record that identifies when a step failed. Limit retries and check the business outcome before repeating a step that may have written data.
Q: Can an RPA flow and a browser script work together?
Yes. An operations-owned flow can handle an approved portal export, while a team-owned script checks the downloaded file or runs staging tests. Define the input, validated output, owner, and failure states at the handoff.