question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Kautomator] auto-scrolling not working properly in screens with several Scrollables

See original GitHub issue

This happens for example in screens containing several Scrollable views like one “CollapsingToolbarLayout” and a “ScrollView/NestedScrollView/RecyclerView…” e.g. the layout I was using to fix ScrollView with padding: Layout with CollapsingToolbarLayout, HorizontalScrollableView and NestedScrollView

Removing the CollapsingToolbarLayout fixes the issue indeed.

That happens because ObjectAutoScrollProvider uses

val scrollable = UiScrollable(UiSelector().scrollable(true))

That scrolls the first scrollable View, in this cases the CollapsingToolbarLayout!

Possible solution: Enable through Kaspresso builder to pass a UiSelector() for the View we want to autoscroll e.g.

class ObjectAutoScrollProviderImpl(
    private val logger: UiTestLogger,
    private val autoScrollParams: AutoScrollParams,
    private val uiScrollSelector: UiSelector = UiSelector().scrollable(true)
) : AutoScrollProvider<UiObjectInteraction> {
...
   val scrollable = UiScrollable(uiScrollSelector)
...

This would give the developer the flexibility for such cases.

Any other suggestion to a better solution is welcome 😃

NOTE: I tested a draft of the proposed solution and it works. I can take this also for 1.4.1 😃

Solution checklist:

  • Works with HorizontalScrollView
  • Works with any “vertical” scrollable view like NestedScrollView

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
sergio-sastrecommented, Nov 8, 2022

Hi, @sergio-sastre! Could you tell if you’re working on this, please?

I’m planning to work on the first point this week, which would be easy. The second one is more complex and will require more time, not sure when I’ll find time for it

1reaction
matzukcommented, Dec 29, 2021

@sergio-sastre Hi Sergio! Sorry, a lot of work now. Let me check and help you next year (January 5th, 6th) =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flake safety auto scroll fails when scroll view has a padding
The problem happens with views that are in the middle of the scrollView, not at the top or at the bottom. AutoScrollProvider scrolls...
Read more >
Auto Scrolling Problems - Microsoft Community
I'm having a weird problem with my PC. Whenever I hover over anything, it auto-scrolls to maximum settings (e.g. the audio settings do...
Read more >
Sergio Sastre - Android developer, Hermes - Polywork
Kaspresso bugfixes. Kautomator autoscroll not working on Views with several Scrollables · Changing language for screenshot not working for RTL languages.
Read more >
7 Ways to Fix Android 12 Scrolling Screenshot Not Working
Fix Scrolling Screenshots Not Working in Android 12 · 1. Update Phone · 2. Restart Phone · 3. Use the Right Method ·...
Read more >
full page scrolling issue on touch device after autoscrolling set ...
Expect issues. The hybrid option is not documented which means is might not work as expected in all possible scenarios.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found