Overview
Spur controls emulators and simulators and interacts with mobile applications the same way a human tester would. The agent sees what is on screen and performs actions — taps, types, scrolls, and waits — based on your instructions. You can also provide high-level instructions and let the agent determine the appropriate interactions. To author a mobile test, provide a clear test name, a description, and the individual steps required to achieve the goal.Write each step as though you are instructing a colleague who is holding the phone.
- Use plain English
- Do not include code, selectors (IDs, XPath), or coordinates
Step Formatting Standards
Follow this structure for every test:- Write one or more sentences per step to describe a single logical action.
- Combine related actions on the same screen into one step when they read naturally together.
Intent Words: Verify vs Check/Validate
Spur interprets these keywords differently:Verify
Use when you need to confirm something that is already visible on screen.This should not require additional interaction.
Check / Validate
Use when Spur may need to perform a small interaction before confirming.
Verify that "Welcome back" is displayedVerify that the user is logged inCheck that the cart shows "1" item(may need to open the cart)
Identifying Elements
Use visible cues so the agent can reliably locate the correct target.| Instead of this | Write this |
|---|---|
| Click element with resource-id “login_btn” | Tap the Log in button |
| Tap button at coordinates (350, 680) | Tap the shopping bag icon with a plus, in the bottom right of the product card |
| Assert element “welcome_text” is displayed | Verify that “Welcome back” is displayed |
Recommended Description Patterns
- Text + position: “Tap Settings in the top right.”
- Icon + position: “Tap the gear icon in the top right.”
- Disambiguation: “Tap the first product in the list.”
Supported Actions
Tap / Click
Tap and Click are interchangeable in Spur.Tap Sign InTap the back arrow in the top leftTap the first product in the list
Tap and Hold (Long Press)
Use when you need to trigger a context menu, drag handle, or secondary action.Long press the profile photo to open the context menuTap and hold the message bubble until the actions menu appears
Type (Text and Numeric Entry)
Where possible, combine credential entry into a single instruction.Enter "user@example.com" as email and "MyPassword!" as password and tap ContinueType "KALLAX" into the search barEnter 10038 as the zipcode and tap Done
Scroll / Swipe
The most reliable approach is to scroll until a specific element is visible.Scroll down until the "Add" button is visible, then tap itScroll down until "Instructions" is visible, then tap it
- Swipe up → reveals content below (scrolls down)
- Swipe left → reveals content to the right
Scroll down (moderately) until the dropdown is visible
Swipe Distance Specification
Distance Formats
You can specify swipe distance in four ways:- Position-based —
bottom,top,middle - Percentage —
30%,50%,60% - Pixels —
100,200,300 - Intensity keywords —
conservative,moderate,aggressive
Swipe Context
When you specify a target element, the swipe is performed within that element’s bounds. When no element is specified, Spur performs a full-screen swipe.
Intensity Keywords
With an element (swipe within element bounds)| Level | Start → End | Distance |
|---|---|---|
| Conservative | 70% → 30% | 40% of element height |
| Moderate | 80% → 20% | 60% of element height |
| Aggressive | 85% → 15% | 70% of element height |
| Level | Start → End | Distance |
|---|---|---|
| Conservative | 70% → 30% | 40% of screen height |
| Moderate | 80% → 20% | 60% of screen height |
| Aggressive | 85% → 15% | 70% of screen height |
Wait
Three patterns that work well:Wait for the app to loadWait 2 secondsTap "Start session" and wait for the main screen to be displayed
Conditional Steps
Mobile applications frequently display popups, permission dialogs, and optional UI. Use the following branching pattern to handle them: Required formatIf "Join our email list" is displayed, tap "No, thank you". Otherwise, skip this step.If "Turn On Bluetooth" is displayed, tap "Not now". Otherwise, skip this step.
Google Password Manager and Chrome notifications are typically dismissed automatically by Spur.
Recommended Test Starting Template
Include the following steps at the top of most mobile tests to establish a consistent starting state:Navigation Reliability
When a step begins with the keyword navigate, Spur applies an additional transition wait (controlled bynavigate_segment_transition_delay). This ensures that screenshots are captured after the screen transition completes.
Example
navigate to the Settings screen and wait for "Settings" to be displayed
Known Limitations
Be aware of the following constraints when authoring mobile tests:- Pinch / zoom gestures are not supported.
- Infinite scroll without a stopping condition can cause endless scrolling. Always include a visibility condition (e.g., “scroll until <element> is visible”).
- Heavy animations can cause timing issues. Add a wait-for-visible condition after the animation completes.
- Hybrid WebView screens can be harder for the agent to detect. If taps repeatedly fail, rewrite the element description to include additional visual cues.
Quick Reference
Copy-and-paste templates for common mobile testing flows.Login and Dismiss Popup
Search and Add to Cart
Next Steps
- Read the Web Prompting Guide for web-specific instructions
- Browse the Prompt Library for ready-to-use prompt patterns
- Try writing your first test
