[{"data":1,"prerenderedAt":20},["ShallowReactive",2],{"blog-post-en-how-to-review-and-fix-ai-built-browser-workflows-in-broma":3},{"slug":4,"lang":5,"title":6,"summary":7,"date":8,"tags":9,"tag_slugs":15,"thumbnail_url":16,"translations":17,"body":18,"asset_base":19},"how-to-review-and-fix-ai-built-browser-workflows-in-broma","en","How to Review and Fix AI-Built Browser Workflows in Broma","Inspect and correct browser workflows built by Broma's AI agent so daily checks keep running when pages change.","2026-11-01",[10,11,12,13,14],"broma","ai-agent","workflow-review","browser-automation","no-code",[10,11,12,13,14],"https:\u002F\u002Fblog-api.bromaapp.com\u002Fapi\u002Fblog\u002Fposts\u002Fhow-to-review-and-fix-ai-built-browser-workflows-in-broma\u002Fthumbnail.svg?lang=en",[5],"Broma’s AI agent can turn a plain-language description into a browser workflow, but the first draft is rarely perfect. Because the agent runs on your own AI—using an API key you provide or your own ChatGPT or Claude subscription—it does not know your internal screens, your login flow, or the exact timing of the sites you check. It also cannot see your Broma app until you run the workflow.\n\nIf you publish an AI-built flow without reviewing it, a small change on a supplier dashboard or a slower page load can break the whole automation. This guide shows how to inspect, test, and correct a workflow that Broma’s AI agent builds for you, using a real-world example: a weekly stock and price check on a public supplier portal.\n\nAll steps happen in the Broma Windows desktop app. Workflows run on your own computer. Broma has no public API, SDK, CLI, or code package, so everything here uses the app’s step editor, selectors, and short JavaScript expressions.\n\n## 1. Describe the task precisely before the AI builds anything\n\nThe AI builds what you ask, not what you meant. A vague prompt produces a vague workflow.\n\nWeak description:\nCheck the supplier site for stock and prices every week.\n\nBetter:\nOpen https:\u002F\u002Fexample-supplier.com\u002Finventory, sign in with the saved profile, search for widget-42, wait for the results table, read the stock quantity and unit price from the first row, take a screenshot of the row, and save the values to the run log.\n\nThe better version names the page, the action, the element to wait for, the data to read, and the output. Give the AI that level of detail in Broma’s task description box. If your site requires a login, use a dedicated browser profile so cookies and logins stay separate from your daily browsing.\n\n## 2. Review the generated draft step by step\n\nDo not run it yet. Look for these common issues:\n\n- Hardcoded text. The AI may type a product name or date that changes every week.\n- Missing waits. A click or read step may fire before the element exists.\n- Fragile selectors. Selectors based on position, such as the third div or the second button, break when the page adds a banner.\n- Wrong branches. The AI may assume a success message always appears and skip the out of stock path.\n- No screenshot or log. Without a checkpoint, you cannot tell where a run failed.\n\nGo through each step and ask: If this page loaded two seconds slower, would this step still work? If the answer is no, add a wait or change the selector.\n\n## 3. Fix selectors so they survive page changes\n\nSelectors are the most common failure point. In Broma, you can target elements by attributes that are less likely to change than layout or position.\n\nPrefer:\n- A stable id or name attribute.\n- A visible label or placeholder text.\n- A data-testid or similar attribute the site exposes for testing.\n\nAvoid:\n- nth-child, nth-of-type, or indexes like the second td.\n- Classes that look generated, such as css-1abc23 or button-v4.\n- Full XPath from the root.\n\nIf the AI used a fragile selector, open the step in Broma, inspect the element in your browser’s developer tools, and replace it with a stable attribute. For example, instead of targeting the third table cell, target the cell whose header says Stock.\n\nWhen you need to read text or make a decision, Broma supports short JavaScript expressions. Keep expressions short and single-purpose. Long scripts are harder to debug in the app and go beyond the no-code intent of the flow.\n\n```js\ndocument.getElementById('stock-qty').innerText.trim()\n```\n\n```js\ndocument.getElementById('price').innerText.replace(\u002F[^\\d.]\u002Fg, '')\n```\n\n## 4. Add waits, branches, and loops where the AI guessed wrong\n\nAI agents often assume a linear path: open, click, type, done. Real web work usually needs conditional logic.\n\nUse Broma’s wait step before reading or clicking dynamic content. Wait for a specific element to appear rather than using a fixed sleep. If the page shows a No results message when an item is out of stock, add a branch:\n\n- If the No results element exists, log out of stock and take a screenshot.\n- Otherwise, read the price and stock fields.\n\nIf you need to check multiple products, add a loop over a list of SKUs instead of duplicating the same steps. Each iteration should open the search field, clear it, type the next SKU, and wait for results before moving on.\n\nA short JavaScript expression can drive a branch. For example:\n\n```js\ndocument.querySelector('.out-of-stock') !== null\n```\n\nThis returns true when the out-of-stock badge exists, letting Broma follow the correct path.\n\n## 5. Test in a clean profile and review the run log\n\nBefore you trust the workflow, run it once in a dedicated browser profile. Broma keeps each profile separate, with its own cookies, logins, extensions, and local storage. This prevents your personal session from interfering with the test and keeps the supplier login isolated.\n\nWatch the first run in the app. Then open the run log and history:\n\n- Did every step complete, or did one step time out?\n- Was the screenshot saved, and does it show the expected row?\n- Are the logged values correct compared with what you see on screen?\n\nIf a step failed, note which one, open the workflow, and fix that step only. Do not rewrite the whole flow. Small, targeted corrections are easier to audit later.\n\n## 6. Save, reuse, and schedule the corrected flow\n\nOnce the workflow passes a test run, save it as a reusable template. Give it a clear name such as Weekly supplier stock check - Widget 42. If your team uses Broma, share the flow so colleagues can run the same steps without rebuilding them.\n\nSet a schedule if the task repeats on a fixed cadence. Broma can run the flow on your computer at the chosen time, and each run adds to the history. Review the history weekly at first, then monthly, to confirm nothing silently broke after a site update.\n\n## 7. Troubleshooting checklist when a page changes\n\nIf a previously working flow stops, work through this list:\n\n1. Open the supplier page manually and compare it to the workflow’s screenshots.\n2. Check whether a login banner, cookie notice, or new navigation bar covers a button the flow clicks.\n3. Verify that the element IDs or labels used in selectors still exist.\n4. Run the flow step by step in the app and pause at the failing step.\n5. Update the selector, add a wait, or fix the branch, then run again.\n\nNever attempt to bypass login walls, CAPTCHAs, or bot protections. Only automate pages and data you are permitted to access, and run checks at a polite pace that respects the site’s terms.\n\n## Conclusion\n\nAI-built workflows are a starting point, not a finished automation. The value comes from reviewing the draft, stabilizing selectors, adding waits and branches, testing in an isolated profile, and checking run logs. Spend ten minutes correcting the AI’s first draft, and you will save hours of manual rework every week.\n","https:\u002F\u002Fblog-api.bromaapp.com\u002Fapi\u002Fblog\u002Fposts\u002Fhow-to-review-and-fix-ai-built-browser-workflows-in-broma\u002Fassets",1794729622491]