Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LongClick does not seem to work #313

Open
dah-fari7009 opened this issue Mar 4, 2022 · 1 comment
Open

LongClick does not seem to work #313

dah-fari7009 opened this issue Mar 4, 2022 · 1 comment

Comments

@dah-fari7009
Copy link

dah-fari7009 commented Mar 4, 2022

Hi,

I am using uiautomator to explore an Android app programmatically ( org.liberty.android.fantastischmemo)

I am trying to perform a long click on a ListView to make a context menu visible, however it seems a click a list view item is performed instead. No context menu shows up and it moves to the next screen (which happens when clicking on a menu item) Here's the code I am using:

from uiautomator import Device
import sys


# get the target device
d = Device(sys.argv[1])

# check whether the resourceId exists
if d(resourceId=sys.argv[2]).exists:
	d(resourceId=sys.argv[2]).long_click()

After the long click, the app transitions from
image
to
image

instead of
image

Thank you!

@dah-fari7009
Copy link
Author

Update: I went around this by using swipe(steps=100) instead

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

No branches or pull requests

1 participant