This section provides example scenarios you can create in Stego.
Each example illustrates a specific action or use case, such as launching an app, scrolling to locate items, or verifying UI behavior.
Launch an App #
You can launch the YouTube app in three different ways:
- Tap the app icon on the home screen
- Search for the app name
- Use the app’s unique identifier (Package Name or Bundle ID)
Launch from Home Screen Icon #
This method launches the app directly from the home screen icon.

Step 1. Create a new step.

Step 2. After screen analysis, select “OD” as the analysis strategy.

Step 3. Select “YouTube” on the screen, then drag and drop it into the UIObject field.

Step 4. Run the step.
Search for App Name to Launch #
This method launches an app by entering its name in the search area.

Step 1. Create a new step with the “Scroll” action.

Step 2. After screen analysis, select “Full Screen” as the analysis strategy.

Step 3. Drag and drop “Full Screen” into the UIObject field.

Step 4. Create a new step with the “Touch” action. Select “OCR” as the analysis strategy,
then drag and drop “Search” from the screen into the UIObject field.

Step 5. Create a new step with the “Input” action. Select “Full Screen” as the analysis strategy,
then drag and drop the screen into the “UIObject” field. Enter “YouTube” in the value field.

Step 6. Create a new step with “Touch” action, choose Crop image from device screen analysis, then drag with your mouse to choose the app icon area and drag & drop to add as UIObject.
Use App Unique ID to Launch Directly #
This method launches the app by specifying its unique ID.

Step 1. Create a new step with the “Launch” action.

Step 2. Enter the app ID (“YouTube”).
- On Android, enter it in Package Name under Attributes.
- On iOS, enter it in Bundle ID.

Step 3. Run the step.
Scroll to Find Items #
This method scrolls through a list until the target video appears.

Step 1. Launch YouTube, search for “Apptest.ai”, and locate the desired video.

Step 2. Create a new step with the “Loop UIObject” action.

Step 3. After screen analysis, select “OCR” as the analysis strategy.


Step 4. Select “Fully Automated” on the screen, then drag and drop it into the UIObject field.

Step 5. Right-click the parent step and select “Insert Child”. Set the child step action to “Scroll”,
select “Full Screen” after screen analysis, and drag and drop it into the child UIObject field.

Step 6. Select the Loop UIObject step and open the Attributes panel. Set the comparator to NOT EXISTS so the step continues scrolling until the target video appears.

Step 7. Return the device to the same screen state as when the scenario was first authored in Stego, then run the steps.
Check Words at Specific Locations #
Identify text in a defined area and reuse it in search. Capture with OCR using a Relative strategy and input the stored variable.

Step 1. Create a new step and select “Store Content”.

Step 2. After screen analysis completes, set analysis strategy to “OCR”.


Step 3. Select “Model” text. Then click “Relative” from the bottom of the analysis strategies toolbar.
Drag and drop the text area next to Model as the step’s UIObject to store the model name.

Step 4. Add a “Touch” step to tap the “Search bar”.
Step 5. Add an “Input” step and set “Attributes › Value” to ${device_model}
.

Step 6. Return to the screen required to start the scenario (here, the device home screen), then run the steps.
Zoom in Google Maps #
Find a location in Google Maps, then zoom in on the map. Search for “Los Angeles” and pinch to zoom.

Step 1. Launch Google Maps and add a Touch step.

Step 2. After screen analysis completes, set Analysis Strategy to “OCR”.

Step 3. Select “Search” on the screen, then drag and drop it to the UIObject field.

Step 4. Add an Input step. Set the Analysis Strategy to Full Screen. Drag and drop the full screen to the UIObject field. Set Attributes › Value to “Los Angeles”.

Step 5. Add a Touch step. Set Analysis Strategy to OCR, then drag and drop “Angeles” to the UIObject field.


Step 6. Multiple “Angeles” items appear on the screen. Open the Attributes panel (click the step’s UIObject field)
and set Attributes › Selector to 2 to target the second “Angeles.”


Step 7. Add a “Pinch” step. In Attributes, set Direction to “OUT”. Set Analysis Strategy to “Custom Box”,
drag to select the center area of the map, then drag and drop it to the UIObject field.

Step 8. Clear the Search field, then run the scenario.
Use Control Actions #
Use “Store Content” and “If Value” to check the Category of the current #1 game in Play Store; if it isn’t “Role Playing”, change it to “Role Playing”.
This example shows how to use the ‘Relative’ analysis strategy to capture text from a specific screen area, store and reuse it, and drive a condition-based flow.

Step 1. Open Play Store and go to Games › Top charts so the current #1 app is visible.
You’ll capture its Category using the Relative Strategy in the next step.

Step 2. Add a Store Content step. Drag and drop “Categories” to the UIObject field as the reference UIObject.
Next, click Relative and drag and drop the #1 app’s Category text to the UIObject field to capture it.

Step 3. Click the Store Content step to open the Attributes panel, then set Attributes › Key to first_category
.


Step 4. Add an If Value step. Open Attributes and set:
- Attributes › Key =
first_category
- Comparator =
!=
- Attributes › Value =
Role Playing
Result: If first_category
!= “Role Playing
“, the child steps run.

Step 5. Right-click the If Value step and Insert Child steps:
- Child 1: Add a Touch step for “Categories” (set Analysis Strategy to OCR, then drag and drop the label to the UIObject field).
- Child 2: Add a Touch step for “Role Playing” in the Categories selection window (same method).

Step 6. Return to the required starting screen, Play Store › Games › Top charts with the #1 app visible, then run the steps.
Stop Playing Video #
Detect a screen change while a YouTube video is playing, then stop playback with a double touch.
Learn how to use Custom Box with If Changed and control a child step.

Step 1. Add an If Changed step.
Step 2. Set Analysis Strategy to “Custom Box” and select the video playback area.
Step 3. Drag and drop it to the UIObject field.

Step 4. Right-click the If Changed step and Insert child.

Step 5. In the child step, set Action to Touch.
Step 6. In Attributes, set Type to Double.
Step 7. Reuse the UIObject from Step 2 by dragging it from existing UIObjects to the child step’s UIObject field.
Step 8. Return to the YouTube player screen with a video playing, then run the steps.
Note
You can add a new UIObject in the child step using Analysis Strategy › Custom Box, but it’s better to reuse the one created in Step 2. To reuse it, pick the saved UIObject from Existing UIObjects and drag and drop it to the child step’s UIObject field.
Set Alarm Time #
Set a desired alarm time in the Android Clock app. Use “Loop UIObject” and “If UIObject” to adjust the time picker.

① Add a new step.
② Set Action to “Touch”.
③ Set Analysis Strategy to “OD”.
④–⑤ Drag and drop the “+” button to the UIObject field.

① Add a Loop UIObject step.
② Set Analysis Strategy to “OCR”.
③ Drag and drop the number “9” to the UIObject field.

④ Open Attributes and set Comparator to “NOT EXISTS”.
⑤ Set Attributes › Limit to 12 so the child steps repeat up to 12 times (time values from 1 to 12).

① Right-click the Loop UIObject step and Insert child.
② Set Action to “Scroll”.
③ Ensure numbers smaller than “9” are visible. Set Analysis Strategy › “Custom Box”.
④ Drag around “6,” then drag and drop it to the UIObject field.
Edge Case (8 or 10)
When the picker shows 8 or 10, 9 may already be visible.
Scroll the hour column by one position:
- If the current hour is 8, set Direction = DOWN (8 → 9)
- If the current hour is 10, set Direction = UP (10 → 9)

① Add an “If UIObject” step.
② Set Analysis Strategy to “OCR”.
③ Drag and drop the number “7” to the UIObject field.
Then, insert a child Scroll step. Set Analysis Strategy › “Custom Box” (hour column). Set Attributes › Direction = DOWN (8 → 9).

① Add an “If UIObject” step.
② Set Analysis Strategy to “OCR”.
③ Drag and drop the number “11” to the UIObject field.
Then, insert a child Scroll step. Set Analysis Strategy › Custom Box (hour column). Set Attributes › Direction = UP (10 → 9).

① Add a child step.
② Choose “Scroll” action.
③ Set Analysis Strategy › Custom Box (hour column).
④ Drag to specify the area around “10”, then drag and drop it to the UIObject field.
⑤ Set Attributes › Direction = UP (10 → 9).
Note — Scroll Direction (content-based)
In Scroll, Direction is defined by content movement, not finger movement.
- DOWN reveals lower items (hour increases, e.g., 8 → 9).
- UP reveals upper items (hour decreases, e.g., 10 → 9).
Example: To change from 10 to 9, set Attributes › Direction = UP.

① Add a “Touch” step.
② Set Analysis Strategy › OCR.
③ Drag and drop “Save” to the UIObject field.
Check Disappearing UI #
This example tests a UI that appears briefly and then disappears (e.g., a toast).
We will verify that the options menu behaves correctly when tapping “Save to Watch later” in YouTube.

① Connect the device to Stego and launch YouTube. Search “apptest ai.” Scroll until apptest’s first video is visible at the top.

① Create a new step.
② Click AI on the device panel.
③ From the analysis results, drag and drop the video options button (⋮) to the UIObject field.

Because multiple icons may appear on this screen, refine the target with Attributes › Selector.
Click the step’s UIObject field to open the modal, then set Selector = 2.

① Create a new step.
② Choose “Touch”.
③ Set Analysis Strategy › OCR.
④ Drag and drop “Save to Watch later” to the UIObject field.
Note
With OCR, words may be recognized separately. Drag across all words to select the full phrase.

① Create a new step.
② Choose “Assert Message”.
③ Verify the toast appears as “Saved to Watch later.”
④ Set Comparator “=”.
⑤ Enter Saved to Watch later in Attributes › Value.

① Run the scenario.
② After completion, check the Output panel.

Review the test results in the Results window.
Check Home Screen Icon #
Verify whether the Play Store app icon exists on the device Home screen.
If it’s missing, a custom error message is shown in the results.

Step 1. Create a new step and choose “Assert UIObject”.

Step 2. Click “AI” on the device panel.

Step 3. On the screen, select the Play Store app icon and drag and drop it to the UIObject field.

Step 4. Open Attributes and set Comparator = “EXISTS”.
Set Custom Message to “Play Store app icon is not on the home screen.”

Step 5. Run the step. If the Play Store icon has been removed from the Home screen,
the assertion fails and the custom message appears in the Output panel.
Use Common Scenario #
Create a reusable app launch as a Common Scenario, then call it from other scenarios.
Create the launch scenario

① Create a new step.
② Choose “Launch”.
③ In Attributes, enter the exact Package Name (Android) or Bundle ID (iOS) of the app to run.

④ In the Scenario List panel, right-click the created scenario and click “Move to Common Scenario”.
Move it to Common Scenario

⑤ The scenario is removed from the Scenario List and added to the “Common Scenario” panel below.
Use the Common Scenario in another scenario

① Add a new scenario.
② Create a new step.

③ Choose “Common Scenario”.

④ In Attributes, choose “Common Scenario”.
⑤-⑥ Select the previously created item from the Common Scenario list.
Note

A Common Scenario added to a step is read-only. To make changes, edit the original Common Scenario.
Send and Receive Email #
Note: Unlike the other examples (single-device), this one uses D2D (Device-to-Device) and runs across two devices.
Verify email send/receive between two devices.
If the recipient doesn’t receive the email, mark the test FAILED and show: “The recipient did not receive the email.”
Open Settings
Click the Settings icon at the top of the Scenario Editor to open Scenario Settings.
User Variables
Add the recipient email as a User Variable:

- key:
Email
- value:
john.doe@example.com
(recipient email)
Enable Scenario Settings › D2D Test, then define roles:

- receiver: receives and checks email
- sender: composes and sends email
In Device Farm, connect one Android device and one iOS device.
Full Scenario

Phase 1: Compose Email (Steps 1-7)
Run the composition flow on the sender device.

- Step 1: Add If Role (Role = sender).
- Steps 2–7 are child steps of Step 1 (If Role) and run only on the sender device.

- Step 2: Add a Launch step to open the mail app on the sender device.
- In Settings › Role Settings, the sender device is set to Random / iOS, so use the app’s Bundle ID.
- Step 3: Add a “Touch” step. Drag and drop the “Compose” button to the UIObject field.

- Step 4: Add an “Input” step.
- Set Attributes › Value to
${Email}
. - Note
${Email}
uses the User Variable from Scenario Settings. At runtime,john.doe@example.com
is entered automatically.
- Set Attributes › Value to

- Step 5: Add a “Touch” step. Set Analysis Strategy › “OD”, then drag and drop the recipient address suggestion to the UIObject field.
- Step 6: Add a “Touch” step. Set Analysis Strategy › “OD”, then drag and drop the “Compose email” message body area to the UIObject field.
- Step 7: Add an “Input” step. Set Analysis Strategy › “Full Screen”, drag and drop the full screen to the UIObject field,
then set Attributes › Value toHi, thank you for using Apptest.ai.
Phase 2: Launch Recipient App (Steps 8-9)
Launch mail app on receiver role device.

- Step 8: Add If Role (Role = receiver).
- Step 9 is a child step of Step 8 (If Role) and runs only on the receiver device.

- Step 9: Launch mail app with Launch action
- In Settings › Role Settings, the receiver device is set to Random / Android, so use the app’s Package Name.
Phase 3: Sync Point (Step 10)
Step 10. Add a “Sync” step to align both devices before proceeding.
Phase 4: Send Email (Steps 11-12)
Run email sending on sender device.

- Step 11: Add “If Role” (Role = sender).
- Step 12 is a child step of Step 11 (If Role) and runs only on the sender device.
- Step 12: Add a “Touch” step. Set Analysis Strategy › “Crop Image”.
Drag to tightly crop the Send icon (minimize whitespace), then drag and drop it to the UIObject field.
Phase 5: Check Email Receipt (Steps 13-14)
Verify that the email arrives on the receiver device.

- Step 13: Add “If Role” (Role = receiver).
- Step 14 is a child step of “Step 13 (If Role)” and runs only on the receiver device.

- Step 14: Verify email arrival and content with “Assert Content”.
- Check that
“Hi, thank you for using Apptest.ai.”
appears on the receiver within 60 seconds. - If it does not appear within this time, mark the test
FAILED
and show“The recipient did not receive the email.”
- Check that