SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.73k stars 8.19k forks source link

How to simulate touch tap? #7088

Closed Linch1 closed 3 years ago

Linch1 commented 5 years ago

Environment OS: Windows 10 Browser: Firefox Browser version: 66.0.2 (32 bit) gekodriver version: 0.24.0 Working with Python3

Problem I'm trying to simulate a touch tap with selenium, this is the interested portion of the code that i wrote for this work

elem = driver.find_element_by_css_selector(".qJfNm")
touch = TouchActions(driver)
touch.tap(elem).perform()

but it raise this error and i don't understand why, i don't know if is my pc/code problem or something else

Traceback (most recent call last):
  File "C:/Users/mcara/OneDrive/Desktop/instagram bot mobile/instagram_bot_mobile.py", line 63, in <module>
    touch.tap(elem).perform()
  File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\common\touch_actions.py", line 47, in perform
    action()
  File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\common\touch_actions.py", line 57, in <lambda>
    Command.SINGLE_TAP, {'element': on_element.id}))
  File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: POST /session/11d3859a-4963-49d9-a143-b11d71fbfa8a/touch/click did not match a known command

I've found nothing online about this issue

AutomatedTester commented 5 years ago

What version of Selenium python client are you using? On Apr 5, 2019, 9:42 PM +0100, Linch1 notifications@github.com, wrote:

Environment OS: Windows 10 Browser: Firefox Browser version: 66.0.2 (32 bit) gekodriver version: 0.24.0 Problem I'm trying to simulate a touch tap with selenium, this is the interested portion of the code elem = driver.find_element_by_css_selector(".qJfNm") touch = TouchActions(driver) touch.tap(elem).perform() it raise this error Traceback (most recent call last): File "C:/Users/mcara/OneDrive/Desktop/instagram bot mobile/instagram_bot_mobile.py", line 63, in touch.tap(elem).perform() File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\common\touch_actions.py", line 47, in perform action() File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\common\touch_actions.py", line 57, in Command.SINGLE_TAP, {'element': on_element.id})) File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\mcara\PycharmProjects\1\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: POST /session/11d3859a-4963-49d9-a143-b11d71fbfa8a/touch/click did not match a known command — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Linch1 commented 5 years ago

i've selenium 3.141.0

cgoldberg commented 5 years ago

Touch events are not working in Firefox currently (version 48.0.1)

@netzulo, Firefox 48 is 3 years old and is not compatible with latest selenium. The rest of your comments are incoherent.

netzulo commented 5 years ago

it isn't but np, just was wasting my own time trying to help , deleted my comment... thank you for your "words"

barancev commented 5 years ago

Python client uses legacy Actions protocol that is not implemented in geckodriver (and never will be). It should be fixed.

On the other hand, new W3C-conformant Actions protocol is not implemented too, watch https://bugzilla.mozilla.org/show_bug.cgi?id=1543337 for the status.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.