Salesforce Browser Automation Skill
This skill enables browser automation for Salesforce orgs authenticated via SF CLI.
Overview
Use the sf-browser-control MCP server tools to:
- •Launch authenticated browser sessions for any SF CLI connected org
- •Navigate Lightning pages, Setup, App Launcher, and object views
- •Fill forms including text fields, picklists, lookups, checkboxes, and dates
- •Create, edit, save, delete, and clone records
- •Capture screenshots and extract page content
Prerequisites
Before using these tools, ensure:
- •SF CLI is installed and authenticated with target orgs (
sf org login web -a alias) - •Playwright browsers are installed (
npx playwright install chromium)
Workflow Pattern
Starting a Session
- •List available orgs: Use
sf_list_orgsto see authenticated orgs - •Start session: Use
sf_session_startwith the desiredorgAlias - •Verify: Use
sf_session_statusto confirm connection
Navigation
- •Home:
sf_navigate_home - •Setup:
sf_navigate_setupwith optionalsectionparameter - •Objects:
sf_navigate_objectwithobjectApiName - •Records:
sf_navigate_recordwithrecordId - •Apps:
sf_navigate_appwithappName
Form Filling
Use these tools in sequence:
- •
sf_record_neworsf_record_editto open form - •
sf_fill_fieldfor text inputs (usefieldLabel) - •
sf_select_picklistfor dropdown fields - •
sf_select_lookupfor relationship fields (searches and selects) - •
sf_check_checkboxfor boolean fields - •
sf_fill_datefor date/datetime fields - •
sf_record_saveto save
Verification
- •
sf_get_toast_message- Check success/error messages - •
sf_screenshot- Capture current state - •
sf_get_field_value- Verify field values - •
sf_get_record_details- Get record information
Key Tools Reference
| Category | Tools |
|---|---|
| Session | sf_session_start, sf_session_status, sf_session_close, sf_list_orgs |
| Navigation | sf_navigate_home, sf_navigate_setup, sf_navigate_object, sf_navigate_record |
| Forms | sf_fill_field, sf_select_picklist, sf_select_lookup, sf_check_checkbox |
| Records | sf_record_new, sf_record_edit, sf_record_save, sf_record_delete |
| Capture | sf_screenshot, sf_get_page_text, sf_get_toast_message |
Tips
- •Always wait for Lightning spinners with
sf_wait_for_spinnerafter navigation - •Use
sf_screenshotliberally to debug issues - •Field labels are case-sensitive - match exactly as shown in UI
- •Lookups require a search term that matches records in the org