GPT Driver User Guide
GPT Driver User Guide
GPT Driver User Guide
  • Getting Started
    • πŸš€Getting Started
    • πŸ”ƒUploading a Build File
    • πŸ§™β€β™‚οΈCreating Tests
      • Commands
        • Tap Command
        • Type Command
        • scroll Command
        • scrollUntilVisible Command
        • swipe Command
        • slide Command
        • wait Command
        • assertVisible Command
        • openLink Command
        • pressBackButton Command
        • launchApp Command
        • restartApp Command
      • πŸ‘οΈwithVision: Instructions
      • 🧠AI Instructions
    • 🏁Executing Tests
  • ☎️Device Configuration
  • βš™οΈUnder the Hood
  • Getting Around
    • ✏️Test Editor
    • πŸ›°οΈTest Overview
    • πŸ…Test Reports
    • ⏺️Test Recordings
    • πŸ‘€Settings
  • Best Practices
    • πŸ§‘β€πŸ’»API Documentation
    • Versioning
    • ↗️Templates
    • πŸ–‡οΈTest Dependencies & Prompt References
    • πŸ”—Deep Links
    • πŸ“§Email Verification
    • πŸ“‘Network Calls
    • πŸͺ‘Parameterized Strings
    • πŸ“Changing Device Location
    • πŸͺΆConditional Steps
    • 🐦Nested Steps
    • ⌚Smart Caching
    • πŸ—£οΈEnv. Variables
    • πŸ’―Bulk Step Testing for Robustness
    • πŸ“–Exact Text Assertions
    • πŸ’¬Auto-grant Permissions
  • πŸ§ͺMocking Network Data
  • 🌎Localization Testing
  • Code Generation
  • ❔FAQs
Powered by GitBook
On this page
  1. Best Practices

Conditional Steps

In test cases involving unscheduled pop-up messages or scenarios like A/B testing, conditional prompts play a crucial role in guiding the testing process intelligently.

PreviousChanging Device LocationNextNested Steps

Last updated 1 month ago

With GPT Driver, these prompts serve as clear instructions. Using the IF , they examine the screen for specific elements like buttons or text. If found, GPT Driver follows through with the appropriate action. If not, it seamlessly continues with the test or jumps ahead as needed.

Here's an example to show how a conditional prompt can be structured:

If <text, element> is displayed on the screen, then tap on <text, element>. Otherwise tap on <text, element>

They're also useful when you may want to wait for a screen to fully load:

Wait until <text, element> is displayed on the screen, then tap on <text, element> otherwise repeat this step.

Another way of achieving this is by adding (optional step) at the beginning of your prompt:

(optional step) Tap on <element>

If the element isn't present on the screen, GPT Driver will automatically proceed to the next step.

By adapting to the current screen conditions, these conditional prompts simplify testing by adjusting to subsequent steps accordingly.

The tool is also aware of which platform the test is currently running on. This is particularly valuable if you will be creating one test that applies to both iOS and Android.

You can use conditional AI steps by first identifying the platform and applying boolean logic for execution. For example:

Check if the platform used in this test is iOS. If it is, {{instruction 1}}. Otherwise, {{instruction 2}}.
πŸͺΆ
action command