Test Execution
Execute your test cases on real browsers using BugBrain’s AI-powered autonomous agents. Watch tests run, capture screenshots, and analyze results.
How Test Execution Works
When you run a test, BugBrain:
- Launches a browser (Chrome, Firefox, or Safari)
- Executes each step using an AI agent
- Captures screenshots at each step
- Records detailed logs of all actions
- Returns results with pass/fail status
Execution Providers
BugBrain supports three execution providers:
Browser-Use Local
What it is: Local Python service with Browser-Use library and Anthropic AI
Best for:
- Standard test execution
- Most test scenarios
- Cost-effective testing
Features:
- Claude AI for intelligent interactions
- Self-healing selectors
- Screenshot capture
- Detailed logging
Hybrid Executor
What it is: Playwright + Gemini AI with self-healing capabilities
Best for:
- Complex applications
- Dynamic selectors
- Self-healing tests
Features:
- AI-powered script generation
- Automatic selector healing on failures
- Playwright stability
- Fast execution
Browser-Use Cloud
What it is: Cloud-hosted Browser-Use service
Best for:
- No local setup needed
- Scalable test execution
- Distributed teams
Features:
- Managed infrastructure
- Automatic updates
- No maintenance required
- Pay-per-use pricing
Your organization admin configures which execution provider to use. All providers support the same test case format.
Execution Options
Browser Selection
Choose which browser to use:
- Chrome (default) - Most compatible
- Firefox - Good for cross-browser testing
- Safari - Mac/iOS testing
Headless Mode
Run browsers without a visible window:
- Headless: On - Faster, uses less resources (default)
- Headless: Off - See the browser window, useful for debugging
Screenshot Capture
Control when screenshots are captured:
- Every Step - Maximum visibility (recommended)
- On Failure - Only when tests fail
- On Assertions - Only at verification points
- Disabled - No screenshots (faster)
Timeouts
Set maximum execution time:
- Default: 300 seconds (5 minutes)
- Range: 30-600 seconds
- Per Test: Can override in test settings
Important: Increase timeout for slow-loading applications or complex workflows. Tests will fail if they exceed the timeout.
Execution Flow
1. Test Queued
When you click “Run Test”:
- Test is added to the execution queue
- Status shows as “Queued”
- Wait time depends on current load
2. Browser Launches
Once execution starts:
- Browser opens (or starts headless)
- Initial page loads
- Status updates to “Running”
3. Steps Execute
For each test step:
- AI agent reads the step description
- Locates the target element
- Performs the action
- Captures screenshot (if enabled)
- Logs the result
4. Results Generated
After all steps complete:
- Overall status determined (Pass/Fail)
- Screenshots compiled
- Logs finalized
- Notifications sent (if configured)
Understanding Results
Pass Status ✅
Test passed if:
- All steps completed successfully
- No errors occurred
- All assertions passed
Fail Status ❌
Test failed if:
- A step couldn’t complete
- Element not found
- Assertion failed
- Timeout exceeded
- Browser error occurred
Warning Status ⚠️
Test passed but with warnings:
- Slow page loads
- Deprecated selectors
- Minor issues that didn’t fail the test
Real-Time Monitoring
While tests run, you can:
Watch Progress:
- See which step is executing
- View live screenshots
- Monitor execution time
View Browser:
- If headless mode is off, watch the browser
- See exactly what the AI agent does
Cancel Execution:
- Click “Cancel” to stop a running test
- Partial results are saved
Execution History
Every test execution is saved with:
- Timestamp - When it ran
- Duration - How long it took
- Status - Pass/Fail/Warning
- Screenshots - Visual record
- Logs - Detailed output
- Environment - Browser, provider used
Access history:
- Go to Test Cases
- Click on a test
- View “Execution History” tab
Concurrent Execution
Run multiple tests at the same time:
Limits by Plan:
- Starter: 2 concurrent executions
- Growth: 5 concurrent executions
- Pro: 10 concurrent executions
Benefits:
- Faster test suite completion
- Parallel test plans
- Efficient resource usage
Best Practices
1. Enable Screenshots Always capture screenshots - they’re invaluable for debugging failures.
2. Set Appropriate Timeouts Allow enough time for pages to load, but not so much that stuck tests run forever.
3. Use Descriptive Selectors Text-based selectors (e.g., “Button with text ‘Submit’”) are more maintainable than CSS selectors.
4. Add Wait Steps Insert waits before assertions to ensure pages are fully loaded.
5. Monitor Execution Time If tests are slow, investigate and optimize page load times or selectors.
6. Review Logs Check execution logs for warnings even when tests pass.
Troubleshooting
Test times out?
- Increase timeout in project settings
- Add explicit wait steps
- Check if page is actually loading
Element not found?
- Verify selector is correct
- Check if element is hidden or in iframe
- Add wait before interacting with element
Flaky tests (pass/fail randomly)?
- Add more wait time
- Use more specific selectors
- Check for race conditions in application
Browser crashes?
- Reduce concurrent executions
- Check for memory-heavy pages
- Contact support if persistent
Performance Tips
Speed up test execution:
- Disable unnecessary screenshots
- Use headless mode
- Reduce wait times where safe
- Run tests in parallel
- Use faster execution provider
Reduce costs:
- Delete old execution results
- Run only necessary tests
- Use test plans for batch execution
- Schedule tests during off-peak hours
Next Steps
- Learn how to run tests
- Create test plans for batch execution
- Set up notifications for test results
- View analytics to track execution trends