Test Execution
TestFlair lets you run your generated test scripts directly from the platform on integrated Selenium and Playwright browser infrastructure. Watch the browser live as the test runs, follow real-time logs, review metrics, and capture screenshots on failure.
This page covers running one script at a time from the Test Scripts tab — the quickest way to check a single test. To run many test cases together as a named, rerunnable set, use Test Runs instead.
Running a Test
- Navigate to the Test Scripts tab in your project
- Select a test script from the list and open its run view
- Enter the target URL of the application you want to test
- Choose your execution preferences (browser window size, timeouts, recording — see below)
- Click Run
Execution Preferences
Before a run you can pick a saved preference or create a new one. A preference controls the browser environment:
| Setting | Options |
|---|---|
| Browser Window Size | Desktop 4K (3840×2160), Desktop Full HD (1920×1200), Desktop HD (1920×1080, default), Tablet Landscape/Portrait, Mobile Landscape/Portrait |
| Maximum Test Duration | 30 / 60 / 90 / 120 / 180 seconds |
| Page Load Time | 15 / 30 / 45 / 60 / 90 seconds |
| Disable Cache | Load everything fresh instead of using saved data |
| Start with Clean Session | Remove all cookies before testing |
| Video Recording | Capture a video of the test |
Saved preferences can be reused across runs, edited, or deleted.
Run Views
The run screen is organized into tabs:
| Tab | Shows |
|---|---|
| Source Code | The generated script (with a class list sidebar when using the Page Object Model) |
| Execution & Logs | The live browser, logs, and metrics during and after a run |
| History | Past executions with status badges and pass/fail counts |
Live Browser Viewing
Within Execution & Logs you can switch between three view modes:
| View Mode | Description |
|---|---|
| Split | Logs and metrics side by side |
| Browser | The live browser session, streamed as the test runs |
| Logs | Full-screen execution logs |
While a test is running, the Browser view streams the actual browser session live (a "Recording in Progress" indicator appears, and the video becomes available for playback once the run completes). This lets you watch every click, type, and navigation as it happens.
Real-Time Logs
Execution logs stream in real time, so you can follow the test as it runs:
- See each test step as it executes, with timestamps and severity (INFO / WARN / ERROR)
- View assertions and their pass/fail status
- A live indicator shows when logs are actively streaming
Execution Metrics
When available, a metrics panel summarizes the run:
- Duration — total run time
- Passed — passed steps out of total
- Failed — failed steps out of total
- Progress — percentage complete
Test Results
After execution completes, each test is marked with a result status:
| Status | Description |
|---|---|
| Passed | All steps and assertions completed successfully |
| Failed | One or more assertions or steps failed |
Viewing Failure Details
When a test fails:
- Review the execution logs to find the failure point
- View the screenshot captured at the moment of failure
- Check the error message and stack trace
Execution History
TestFlair keeps a full history of every test run for each test case. From the test scripts view you can:
- View all past executions with their date, status, and duration
- Open any historical execution to review its logs and results
- Compare the latest run against previous runs to spot regressions
- Access execution details including pass/fail metrics and error traces
This makes it easy to track test stability over time and identify flaky tests.
Automatic Bug Creation
When a test fails, you can create a bug report directly:
- Click Create Bug on a failed test result
- The bug form is pre-filled with:
- Title from the test name
- Failure details and error information
- Screenshot attached as evidence
- The bug is automatically linked to the originating test case
- Add any additional details and save
AI Bug Suggestions
TestFlair can also use AI to analyze test execution failures and suggest bug reports automatically. After a failed execution:
- Click Generate Bugs to let the AI analyze the failure logs
- Review the AI-generated bug suggestions — each includes a pre-filled title, description, and failure context
- Accept, modify, or dismiss each suggestion
- Accepted bugs are created and linked to the originating test case
This is especially useful after batch executions where multiple tests may fail.
AI bug generation is a Beta feature and may not be visible on every account.
See the Bugs page for more on bug management.
Testing Local Applications
If your application runs locally (e.g., localhost:3000) or behind a firewall, you need to set up a tunnel so TestFlair's cloud browser infrastructure can reach it.
Tunneling is a Beta feature and may not be visible on every account.
Tunnel Setup
- Click the Tunnel Setup option before running your test
- Choose a tunnel provider:
- Cloudflare Tunnel (recommended)
- ngrok
- Follow the platform-specific installation instructions (Windows, Mac, or Linux)
- Run the provided command to start the tunnel
- Use the tunnel URL as your target URL when running tests
The tunnel setup modal provides copy-to-clipboard commands for quick setup. Click the copy icon next to each command.
Screenshots
Screenshots are captured automatically when tests fail, providing visual evidence of the application state at the point of failure. Screenshots are:
- Attached to the test result
- Included in auto-generated bug reports
- Viewable directly in the execution results
Troubleshooting
Tests failing unexpectedly?
- Verify the target URL is correct and accessible
- Check that the application is running and responding
- Review the execution logs for specific error messages
Connection issues?
- If testing a local app, ensure your tunnel is active
- Verify your internet connection is stable
Timeouts?
- The application may be slow to respond — check its performance
- Verify the target URL loads correctly in a regular browser
Next Steps
- Test Runs — Run many test cases together and track them as a set (Beta)
- Bugs — Manage bugs created from failed tests
- Test Scripts — Edit and manage your test scripts
- AI Browser Automation — Let AI drive the browser live (Beta)
- Dashboard — View test execution statistics