Skip to main content

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​

  1. Navigate to the Test Scripts tab in your project
  2. Select a test script from the list and open its run view
  3. Enter the target URL of the application you want to test
  4. Choose your execution preferences (browser window size, timeouts, recording — see below)
  5. Click Run

Run test script

Execution Preferences​

Before a run you can pick a saved preference or create a new one. A preference controls the browser environment:

SettingOptions
Browser Window SizeDesktop 4K (3840×2160), Desktop Full HD (1920×1200), Desktop HD (1920×1080, default), Tablet Landscape/Portrait, Mobile Landscape/Portrait
Maximum Test Duration30 / 60 / 90 / 120 / 180 seconds
Page Load Time15 / 30 / 45 / 60 / 90 seconds
Disable CacheLoad everything fresh instead of using saved data
Start with Clean SessionRemove all cookies before testing
Video RecordingCapture a video of the test

Saved preferences can be reused across runs, edited, or deleted.

Run Views​

The run screen is organized into tabs:

TabShows
Source CodeThe generated script (with a class list sidebar when using the Page Object Model)
Execution & LogsThe live browser, logs, and metrics during and after a run
HistoryPast executions with status badges and pass/fail counts

Live Browser Viewing​

Within Execution & Logs you can switch between three view modes:

View ModeDescription
SplitLogs and metrics side by side
BrowserThe live browser session, streamed as the test runs
LogsFull-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:

StatusDescription
PassedAll steps and assertions completed successfully
FailedOne or more assertions or steps failed

Viewing Failure Details​

When a test fails:

  1. Review the execution logs to find the failure point
  2. View the screenshot captured at the moment of failure
  3. Check the error message and stack trace

Failed test details

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:

  1. Click Create Bug on a failed test result
  2. The bug form is pre-filled with:
    • Title from the test name
    • Failure details and error information
    • Screenshot attached as evidence
  3. The bug is automatically linked to the originating test case
  4. 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:

  1. Click Generate Bugs to let the AI analyze the failure logs
  2. Review the AI-generated bug suggestions — each includes a pre-filled title, description, and failure context
  3. Accept, modify, or dismiss each suggestion
  4. Accepted bugs are created and linked to the originating test case

This is especially useful after batch executions where multiple tests may fail.

Beta feature

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.

Beta feature

Tunneling is a Beta feature and may not be visible on every account.

Tunnel Setup​

  1. Click the Tunnel Setup option before running your test
  2. Choose a tunnel provider:
    • Cloudflare Tunnel (recommended)
    • ngrok
  3. Follow the platform-specific installation instructions (Windows, Mac, or Linux)
  4. Run the provided command to start the tunnel
  5. Use the tunnel URL as your target URL when running tests

Tunnel setup modal

tip

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