Resolution Process
When you perform an action with adescription parameter, OpenSteer follows a 5-step resolution process:
- Reuse persisted selector - Check if a selector was previously saved for this description
- Snapshot counter - Use the
elementcounter from the current snapshot - Explicit CSS selector - Use the provided
selectorparameter - LLM resolution - Ask the configured AI model to locate the element from the description
- Actionable error - Return a detailed error with diagnostic information
Selector Persistence
When OpenSteer successfully resolves an element through steps 2-4 and adescription is present, the resolved selector path is automatically saved to disk.
Storage Location
Selectors are stored in.opensteer/selectors/<namespace>/:
Selector File Structure
Each persisted selector file contains:The namespace comes from the
name parameter in new Opensteer({ name: 'my-app' }). For CLI usage, use the --name flag to set the namespace.Description-Based Targeting
Description-based targeting allows you to identify elements using natural language rather than brittle CSS selectors or XPath expressions.When to Use Descriptions
Use descriptions for:- Semantic targeting - “login button”, “search input”, “user profile link”
- Dynamic content - Elements that may change position but maintain purpose
- Maintainable scripts - Scripts that should survive UI refactors
- AI agent workflows - Autonomous agents that need reliable element identification
Deterministic Replay
The persistence system enables deterministic replay, where subsequent runs of the same script use cached selectors instead of making LLM calls.Benefits
Faster Execution
Skip LLM resolution on subsequent runs by reusing persisted selectors
Reduced Costs
Avoid repeated LLM API calls for the same element lookups
Consistency
Same description always resolves to the same element across runs
Offline Support
Run scripts without LLM access once selectors are cached
Replay Flow
Fallback Options
While descriptions are powerful, OpenSteer provides explicit fallback options:Best Practices
Use consistent namespaces
Use consistent namespaces
Keep the
name parameter the same across runs to reuse cached selectors.Take snapshots before actions
Take snapshots before actions
Always call
snapshot({ mode: 'action' }) before interactions to ensure fresh element counters.Use descriptive descriptions
Use descriptive descriptions
Write clear, semantic descriptions that uniquely identify the target element.
Commit selector files to version control
Commit selector files to version control
Check
.opensteer/selectors/ into git to share cached selectors across team members and CI/CD environments.Related
Snapshot Modes
Learn about different snapshot modes and when to use them
Actions API
Complete API reference for click, input, hover, and more