Skip to content

[BUG] scrollUntilVisible fails when run inside repeat #26

@7ammer

Description

@7ammer

Description

scrollUntilVisible fails when used inside a repeat block if the tapped element changes its text from "Favourite" to "Unfavourite". The first iteration succeeds, but subsequent iterations time out and tapOn fails with no such element.

The same commands work correctly when written sequentially outside of a repeat block.

Steps to Reproduce

  1. Run command maestro test my-flow.yaml
  2. With flow file (see below)
  3. Observe failure inside repeat after the first iteration

Expected Behaviour

Each iteration should:

  1. Execute scrollUntilVisible for "Favourite"
  2. Tap "Favourite"
  3. Repeat successfully for the configured number of times

Actual Behaviour

The first iteration succeeds. On the second iteration:

  • scrollUntilVisible runs but eventually times out
  • tapOn fails with no such element
  • The repeat block fails with context deadline exceeded

Environment

  • OS: macOS (darwin/arm64)

  • Go version: go1.26.0

  • maestro-runner version: 1.0.8-rc2

    • Commit: b01ce7d
    • Built: 2026-02-27T14:52:52Z
  • Executor: UIAutomator2

  • Device/Simulator: Pixel 6 API 34 Emulator

Flow File

appId: abc
---
- repeat:
    times: 3
    commands:
      - scrollUntilVisible:
          element: "Favourite"
      - tapOn: "Favourite"

Error Output

✗ repeat (41.6s)
    ╰─ Element not found: context deadline exceeded: no such element: An element could not be located on the page using the given search parameters
    ✓ scrollUntilVisible (3.4s)
    ✓ tapOn (243ms)
    ⚠ scrollUntilVisible (20.1s)
    ✗ tapOn (17.3s)
      ╰─ context deadline exceeded: no such element: An element could not be located on the page using the given search parameters

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions