Configuration¶
Environment Variables¶
| Variable | Description | Default |
|---|---|---|
AXTERMINATOR_VLM_BACKEND |
VLM backend | None |
AXTERMINATOR_VLM_API_KEY |
VLM API key | None |
AXTERMINATOR_TIMEOUT_MS |
Default timeout | 5000 |
AXTERMINATOR_LOG_LEVEL |
Log level | INFO |
HealingConfig¶
import axterminator as ax
config = ax.HealingConfig(
strategies=[
"data_testid", # Developer-set IDs (most stable)
"aria_label", # Accessibility labels
"identifier", # AX identifier
"title", # Element title
"xpath", # Structural path
"position", # Screen position
"visual_vlm", # AI vision (slowest)
],
max_heal_time_ms=100, # Total time budget for healing (ms), default: 100
)
Strategy Details¶
| Strategy | Stability | Speed | Notes |
|---|---|---|---|
data_testid |
Highest | Fast | Set by developers |
aria_label |
High | Fast | Accessibility-focused |
identifier |
High | Fast | System-assigned |
title |
Medium | Fast | May change with i18n |
xpath |
Low | Medium | Breaks on structure changes |
position |
Lowest | Fast | Breaks on layout changes |
visual_vlm |
High | Slow | Requires VLM backend |
VLM Configuration¶
MLX (Local, Recommended)¶
No API key needed. Uses Apple Silicon GPU.
Ollama (Local)¶
Requires Ollama running locally.
Anthropic (Cloud)¶
OpenAI (Cloud)¶
Gemini (Cloud)¶
Logging¶
import logging
# Enable debug logging
logging.basicConfig(level=logging.DEBUG)
# Or via environment
# AXTERMINATOR_LOG_LEVEL=DEBUG
pytest Integration¶
# conftest.py
import pytest
@pytest.fixture
def ax_app():
"""Fixture to get app connections."""
import axterminator as ax
def _get_app(name):
return ax.app(name=name)
return _get_app
@pytest.fixture
def ax_wait():
"""Fixture for waiting."""
import time
return time.sleep