Skip to content

fix(flutter): accept a FlutterFinder as scrollView in scroll_till_visible - #1352

Merged
KazuCocoa merged 1 commit into
appium:masterfrom
MattL1989:fix/flutter-scroll-view-finder
Nov 2, 2026
Merged

KazuCocoa merged 1 commit into
appium:masterfrom
MattL1989:fix/flutter-scroll-view-finder

Conversation

@MattL1989

Copy link
Copy Markdown
Contributor

Problem

The scroll_till_visible docstring describes the scrollView keyword argument as scrollView (str): The view of the scroll. Default value is 'Scrollable'. The client sends whatever it is given unchanged:

  • A string, as documented. The server rejects it. appium-flutter-server parses scrollView with FindElementModel.fromJson(json['scrollView'] as Map<String, dynamic>), so it must be a finder map.
  • A FlutterFinder, the type the other Flutter commands take. It fails on the client with TypeError: Object of type FlutterFinder is not JSON serializable.
  • A dict built with FlutterFinder.to_dict(). This is the only form that works, which is what the existing unit test uses.

Fix

  • If scrollView is a FlutterFinder, convert it with .to_dict(), the same way the target finder is converted.
  • Dicts keep working unchanged, so this is backward compatible.
  • Correct the docstring to scrollView (FlutterFinder | dict). When scrollView is omitted, the server uses the first Scrollable widget (find.byType(Scrollable)).

Tests

  • Added a unit test that passes scrollView=FlutterFinder.by_key(...) and checks the finder map that is sent. Without the fix it fails with TypeError: Object of type FlutterFinder is not JSON serializable.
  • ruff check, ruff format --check, mypy appium and the full unit test suite pass. Merged together with the horizontal-scroll fix (fix(flutter): support horizontal scrolling in scroll_till_visible #1351) it also merges cleanly and passes.

🤖 Generated with Claude Code

…ible

The scroll_till_visible docstring described scrollView as a string with
the default 'Scrollable', but the Flutter integration server parses
scrollView as a finder map (FindElementModel), so a string fails on the
server. Passing a FlutterFinder, which is what the other Flutter commands
take, failed on the client with "Object of type FlutterFinder is not JSON
serializable"; only a hand-built dict from FlutterFinder.to_dict() worked.

Convert a FlutterFinder scrollView to its dict form, keep accepting dicts,
and document the argument correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KazuCocoa
KazuCocoa merged commit 1ac4254 into appium:master Nov 2, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants