Best approach to generate production-ready Playwright scripts for ~10 heavily customized Salesforce-based CRMs?
Ciao everyone,
I'm working on a project to automate order creation on our suppliers' CRM portals. Most of them are built on Salesforce, but each one is heavily customized, so the flows differ a lot from one supplier to another. The flows are long and multi-step: an experienced user takes about 5–8 minutes per order, mostly copying and pasting data from our internal CRM into the supplier's portal. We handle around 50 orders a day.
I started writing Playwright automations with codegen, but development is very slow, and I have around 10 different supplier CRMs to cover.
Some context and constraints:
- No APIs: the suppliers don't provide or allow API access, so UI automation is the only option.
- Authentication is solved: MFA is handled programmatically via TOTP, no issues there.
- Portals are stable: the UIs rarely change, so a deterministic script would stay valid for a long time once written.
- Why not RPA: I'm comfortable with Playwright, and the UiPath quote I received was far beyond our budget.
- Stack is open: I'm not tied to a language, and I'm even open to alternatives to Playwright if there's a better fit.
So far I've tried generating the Playwright code with:
- browser-use harness
- Playwright MCP
- Stagehand by Browserbase
- Browserbase Agent
- Claude Chrome Extension
- chrome-cdp-skill
With very specific prompts that force the AI through the task step by step, most of these tools can complete the flow. But that's not really what I need: I want the AI to perform the task once, "look" at how the pages are built, and output a deterministic Playwright script I can run in production without an LLM in the loop.
The generated code has been consistently poor: brittle selectors, reliance on Salesforce's dynamic IDs, badly handled waits, and missing steps. Getting it production-ready takes a huge number of iterations, which defeats the purpose.
Has anyone tackled something similar? I'd love to hear how you'd approach this differently, whether that's a different tool, a better workflow (e.g. recording plus AI refactoring, page object generation), or tips specific to Salesforce UIs. Anything that speeds up writing reliable Playwright code would help.
Thanks!
1 point · 2 comments
Mentions
Best approach to generate production-ready Playwright scripts for ~10 heavily customized Salesforce-based CRMs? Ciao everyone, I'm working on a project to automate order creation on our suppliers' CRM portals. Most of them are built on Salesforce, but each one is heavily customized, so the flows differ a lot from one supplier to another. The flows are long and multi-step: an experienced user takes about 5–8 minutes per order, mostly copying and pasting data from our internal CRM into the supplier's portal. We handle around 50 orders a day. I started writing Playwright automations with codegen, but development is very slow, and I have around 10 different supplier CRMs to cover. Some context and constraints: - No APIs: the suppliers don't provide or allow API access, so UI automation is the only option. - Authentication is solved: MFA is handled programmatically via TOTP, no issues there. - Portals are stable: the UIs rarely change, so a deterministic script would stay valid for a long time once written. - Why not RPA: I'm comfortable with Playwright, and the UiPath quote I received was far beyond our budget. - Stack is open: I'm not tied to a language, and I'm even open to alternatives to Playwright if there's a better fit. So far I've tried generating the Playwright code with: - browser-use harness - Playwright MCP - Stagehand by Browserbase - Browserbase Agent - Claude Chrome Extension - chrome-cdp-skill With very specific prompts that force the AI through the task step by step, most of these tools can complete the flow. But that's not really what I need: I want the AI to perform the task once, "look" at how the pages are built, and output a deterministic Playwright script I can run in production without an LLM in the loop. The generated code has been consistently poor: brittle selectors, reliance on Salesforce's dynamic IDs, badly handled waits, and missing steps. Getting it production-ready takes a huge number of iterations, which defeats the purpose. Has anyone tackled something similar? I'd love to hear how you'd approach this differently, whether that's a different tool, a better workflow (e.g. recording plus AI refactoring, page object generation), or tips specific to Salesforce UIs. Anything that speeds up writing reliable Playwright code would help. Thanks!