LogoLogo
  • Overview
    • Quickstart
    • FAQ
    • Overview
    • Pricing
    • Comparison
    • Discord
  • Pro Setup
    • Book a Demo
    • 30x30 Promotion
  • Guides
    • Generate a Test Suite
    • Local Agent Setup
    • Prompting
    • Getting an API Key
    • GitHub Actions
      • GitHub Action Setup
      • Prerun Scripts
      • Environment Config
      • Parallel Testing
      • Storing Secrets
      • Optimizing Performance
      • Action Output
      • Examples
        • Test Generation
        • Parallel Testing
        • Importing Tests
        • Desktop Apps
        • Secure Log In
    • Debugging Test Runs
    • Monitoring Performance
  • Reference
    • Test Steps
      • assert
      • exec
      • focus-application
      • hover-image
      • match-image
      • hover-text
      • if
      • press-keys
      • remember
      • run
      • scroll
      • scroll-until-image
      • scroll-until-text
      • type
      • wait
      • wait-for-image
      • wait-for-text
    • Interactive Commands
      • /assert
      • /undo
      • /save
      • /run
      • /generate
    • CLI
      • testdriverai init
      • testdriverai [file]
      • testdriverai run [file]
  • Security & Privacy
    • Agent
    • Action
    • Dashboard
  • FAQ
    • Screen Recording Permissions (Mac Only)
    • Status Page
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Reference
  2. Test Steps

if

If the condition is true, runs the commands in the block. Otherwise, runs the commands in the else block.

Argument
Type
Description

condition

string

The condition to evaluate.

then

list of commands

The commands to run if the condition is true.

else

list of commands

The commands to run if the condition is false.

Example Usage

command: if
condition: the active window is "Google Chrome"
then:
  - command: hover-text
    text: Search Google or type a URL
    description: main google search
    action: click
  - command: type
    text: monster trucks
    description: search for monster trucks
else:
  - command: focus-application
    name: Google Chrome
Previoushover-textNextpress-keys

Last updated 8 months ago

Was this helpful?