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.

Make 'touch' the default interaction

See original GitHub issue

I have a very simple test that scrolls down on a list of elements and works well when I use the UIAutomator2 driver for Android or XCUITest driver for iOS, but it fails as soon as I switch to the Espresso driver.

For what is worth the app is written on React Native so that might have something to do with the issue I’m seeing, but I still think that since it works on the other two drivers (XCUITest and UIAutomator2) this should work on the Espresso driver as well.

I’m using the Python client and this is a simplified version of my code:

top_element = get_element('top-cell')
bottom_element = get_element('bottom-cell')
actions = TouchAction(driver)
(actions.long_press(bottom_element)
         .move_to(top_element)
         .release()

def get_element(element_id):
        element_ready = expected_conditions.presence_of_element_located(
            (MobileBy.ACCESSIBILITY_ID, element_id))
        return self.wait.until(element_ready)

And these are the relevant Appium Server logs. There are no errors on the logs as you can see, but the app simply doesn’t scroll.

[JSONWP Proxy] Proxying [POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element/fdf24285-b9c2-4723-9e62-42d9a311b401/click] to [POST http://localhost:8080/session/0c5eb84a-7ec8-491f-b30f-d7b1d429438d/element/fdf24285-b9c2-4723-9e62-42d9a311b401/click] with body: {"id":"fdf24285-b9c2-4723-9e62-42d9a311b401","sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[JSONWP Proxy] Got response with status 200: {"id":"f95ef160-e24d-4916-bdeb-893af2139dba","sessionId":"0c5eb84a-7ec8-491f-b30f-d7b1d429438d","status":0,"value":null}
[JSONWP Proxy] Replacing sessionId 0c5eb84a-7ec8-491f-b30f-d7b1d429438d with b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29
[HTTP] <-- POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element/fdf24285-b9c2-4723-9e62-42d9a311b401/click 200 419 ms - 120
[HTTP] 
[HTTP] --> POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element
[HTTP] {"using":"accessibility id","value":"top-cell","sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[W3C] Driver proxy active, passing request on via HTTP proxy
[JSONWP Proxy] Matched '/wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element' to command name 'findElement'
[JSONWP Proxy] Proxying [POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element] to [POST http://localhost:8080/session/0c5eb84a-7ec8-491f-b30f-d7b1d429438d/element] with body: {"using":"accessibility id","value":"top-cell","sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[JSONWP Proxy] Got response with status 200: {"id":"62c6e291-5ef1-4543-908c-e301166b3f00","sessionId":"0c5eb84a-7ec8-491f-b30f-d7b1d429438d","status":0,"value":{"ELEMENT":"6be7e18b-e62a-4ec1-8c7c-cb9976845b59"}}
[JSONWP Proxy] Replacing sessionId 0c5eb84a-7ec8-491f-b30f-d7b1d429438d with b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29
[HTTP] <-- POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element 200 57 ms - 166
[HTTP] 
[HTTP] --> POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element
[HTTP] {"using":"accessibility id","value":"bottom-cell","sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[W3C] Driver proxy active, passing request on via HTTP proxy
[JSONWP Proxy] Matched '/wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element' to command name 'findElement'
[JSONWP Proxy] Proxying [POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element] to [POST http://localhost:8080/session/0c5eb84a-7ec8-491f-b30f-d7b1d429438d/element] with body: {"using":"accessibility id","value":"bottom-cell","sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[JSONWP Proxy] Got response with status 200: {"id":"49a5d26d-daa1-4fbb-a796-9887aa8b17c7","sessionId":"0c5eb84a-7ec8-491f-b30f-d7b1d429438d","status":0,"value":{"ELEMENT":"51fd0f10-715c-463a-8259-82f32b0ad454"}}
[JSONWP Proxy] Replacing sessionId 0c5eb84a-7ec8-491f-b30f-d7b1d429438d with b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29
[HTTP] <-- POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/element 200 57 ms - 166
[HTTP] 
[HTTP] --> POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/touch/perform
[HTTP] {"actions":[{"action":"longPress","options":{"element":"51fd0f10-715c-463a-8259-82f32b0ad454","duration":1000}},{"action":"moveTo","options":{"element":"6be7e18b-e62a-4ec1-8c7c-cb9976845b59"}},{"action":"release","options":{}}],"sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[W3C] Driver proxy active, passing request on via HTTP proxy
[JSONWP Proxy] Matched '/wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/touch/perform' to command name 'performTouch'
[JSONWP Proxy] Proxying [POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/touch/perform] to [POST http://localhost:8080/session/0c5eb84a-7ec8-491f-b30f-d7b1d429438d/touch/perform] with body: {"actions":[{"action":"longPress","options":{"element":"51fd0f10-715c-463a-8259-82f32b0ad454","duration":1000}},{"action":"moveTo","options":{"element":"6be7e18b-e62a-4ec1-8c7c-cb9976845b59"}},{"action":"release","options":{}}],"sessionId":"b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29"}
[JSONWP Proxy] Got response with status 200: {"id":"40ebf152-76eb-40a9-bf33-36f1a99f87a9","sessionId":"0c5eb84a-7ec8-491f-b30f-d7b1d429438d","status":0,"value":null}
[JSONWP Proxy] Replacing sessionId 0c5eb84a-7ec8-491f-b30f-d7b1d429438d with b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29
[HTTP] <-- POST /wd/hub/session/b8d1d506-c81d-4b1c-b4ee-ff7c1a677b29/touch/perform 200 599 ms - 120

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
dpgrahamcommented, Oct 16, 2018

@juandg Actually I think the issue may be that the element is being rendered but it’s not on the screen. Which the scroll-to behaviour doesn’t work for. So yeah, I would just stick with using the scroll actions.

1reaction
juandgcommented, Oct 16, 2018

Pause is mandatory as WDA expects that

@saikrishna321 Thanks for clarifying that’s really helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interactions | Input System | 1.0.2 - Unity - Manual
Default Interaction ; Press; Hold; Tap; SlowTap; MultiTap. Custom Interactions. An Interaction represents a specific input pattern.
Read more >
Input System Interactions Explained - Unity - YouTube
I go what makes an interaction, how it impacts the actions, ... Then, I'll be going over each interaction individually, Press, Hold, Tap, ......
Read more >
Touch interactions - Windows apps - Microsoft Learn
Some three- and four-finger touch interactions will no longer work in Windows apps by default.
Read more >
touch-action - CSS: Cascading Style Sheets - MDN Web Docs
The touch-action CSS property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into ......
Read more >
touch-action - CSS-Tricks
By default, a browser will handle touch interactions automatically: Pinch to zoom, swipe to scroll, etc. Setting touch-action to none will ...
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