Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:05:19+00:00 2026-06-14T05:05:19+00:00

It takes 5-6 seconds to find some UI control (as example a button). Two

  • 0

It takes 5-6 seconds to find some UI control (as example a button).

Two questions:

1) Why is it so slow?

2) Is there a way to make it faster or some alternative solution for finding UI control (in scope of monkeyrunner testing)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:05:19+00:00Added an answer on June 14, 2026 at 5:05 am

    I looked into Android source code a little bit and found that when you search for a control using findViewById in monkeyrunner, it actually iterates through all controls on all running windows in Android.

    So, if you have some Activity which is paused (and not visible), by not destroyed, findViewById will spend time searching through it.

    I have several ideas for now

    a) Use getFocusedWindowName API on HierarhyViewer to check that correct window is displayed.
    Try to search this window first and after specify it as parent in findViewById(id, parent) method. This way, we won’t search through all windows on Android.

    2) Try to bypass interface provided by com.android.chimpchat.hierarchyviewer.HierarchyViewer and go directly to DeviceBridge class (which provides a little bit lower level for the same protocol). In such case, instead of acquiring all controls for all windows, we can precisely point which window should be searched.

    As Romain pointed out. HierarchyViewer may change in the future. However, I don’t see any other replacement for this, as part of testing automation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control that takes a several seconds to load. Is there
This code takes 3 seconds on Chrome and 6s on Firefox. If I write
This query takes ~4 seconds to complete: SELECT DISTINCT resources_resource.id, resources_resource.heading, resources_resource.name, resources_resource.old_name, resources_resource.clean_name,
To create and show a form takes 10 seconds and i want to shorten
I execute an ajax function that takes 3 seconds + so in this time
I'm having a problem with this query that takes several seconds to complete. I
We have the query below. Using a LEFT OUTER join takes 9 seconds to
This query takes about 52 seconds to complete. It appears 82% of the time
Say a website on my localhost takes about 3 seconds to do each request.
I am sending an email and it takes a few seconds to collect data,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.