TouchAction().perform() - Method has not yet been implemented

Hello, help me pls.
When i use perform method, it’s says WebDriverException: Message: Method has not yet been implemented.

Appium - 1.6.3
My capabilities:

self.driver = webdriver.Remote(
command_executor=‘http://0.0.0.0:4723/wd/hub’,
desired_capabilities={
‘app’: app,
‘appium-version’: ‘1.6.3’,
‘platformName’: ‘Android’,
‘platformVersion’: ‘5.1.1’,
‘deviceName’: ‘Nexus 7’,
‘appPackage’: pack,
‘appActivity’: act
})

Example of tap what i try:

self.driver.tap([(400, 400)])
and
touch = TouchAction(self.driver)
touch.press(x=400, y=400).release()

Both options lead to error:

debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“tap”,“options”:{“y”:400,“x”:400,“count”:1}}],“fa7095a9-b90c-4710-b356-ad1f7b7698b4”]
[HTTP] ← POST /wd/hub/session/fa7095a9-b90c-4710-b356-ad1f7b7698b4/touch/perform 501 5 ms - 122
[HTTP] → DELETE /wd/hub/session/fa7095a9-b90c-4710-b356-ad1f7b7698b4 {}
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: [“fa7095a9-b90c-4710-b356-ad1f7b7698b4”]
[debug] [AndroidDriver] Shutting down Android driver

Error
Traceback (most recent call last):
File “/Users/admin/PycharmProjects/tests/andro_new.py”, line 49, in test_scroll
self.driver.tap([(400, 400)])
File “/Users/admin/PycharmProjects/tests/appium/webdriver/webdriver.py”, line 226, in tap
action.perform()
File “/Users/admin/PycharmProjects/tests/appium/webdriver/common/touch_action.py”, line 94, in perform
self._driver.execute(Command.TOUCH_ACTION, params)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 236, in execute
self.error_handler.check_response(response)
File “/Users/admin/PycharmProjects/tests/appium/webdriver/errorhandler.py”, line 29, in check_response
raise wde
WebDriverException: Message: Method has not yet been implemented

I suppose tap we cannot use tap actions in Appium 1.6.3

What can we use instead?
I need click by this coordinates
Can i create any object with coordinates for use .click() method?

new TouchAction((MobileDriver) driver).tap(x, y).perform();
new TouchAction((MobileDriver) driver).press(x, y).waitAction(50).release().perform();

Doesn’t work for me.

i have tried already

self.driver.scroll(el1, el2)
el = self.driver.find_element_by_id('id')
self.driver.execute_script('mobile: scroll', {"element": el, "toVisible": True})
touch = TouchAction(self.driver)
touch.press(el1).wait(ms).move_to(el2).release().perform()

in the last case, I have got an error

what error in last case? add appium logs.

Sorry, i little bit mistaken.
When i use

touch.press(el1).wait(10).move_to(el2).release().perform()

I got response, like below.

[HTTP] → POST /wd/hub/session/dcb6859a-724c-45cd-a679-2f85da79bcb1/touch/perform {“sessionId”:“dcb6859a-724c-45cd-a679-2f85da79bcb1”,“actions”:[{“action”:“press”,“options”:{“y”:null,“x”:null,“element”:“45FA624D-1539-49DB-818B-4E8891EBAFBE”}},{“action”:“wait”,“options”:{“ms”:10}},{“action”:“moveTo”,“options”:{“y”:null,“x”:null,“element”:“D279DC52-7AC2-4302-93D5-CF7CA515E9EE”}},{“action”:“release”,“options”:{}}]}
[debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“y”:null,“x”:null,“element”:“45FA624D-1539-49DB-818B-4E8891EBAFBE”}},{“action”:“wait”,“options”:{“ms”:10}},{“action”:“moveTo”,“options”:{“y”:null,“x”:null,“element”:“D279DC52-7AC2-4302-93D5-CF7CA515E9EE”}},{“action”:“release”,“options”:{}}],“dcb6859a-724c-45cd-a679-2f85da79bcb1”]
[debug] [XCUITest] Executing command ‘performTouch’
[debug] [XCUITest] Received the following touch action: press-wait-moveTo-release
[debug] [JSONWP Proxy] Proxying [GET /element/45FA624D-1539-49DB-818B-4E8891EBAFBE/rect] to [GET http://localhost:8100/session/858F3407-B678-4BC5-AF12-FAF8BD676D0C/element/45FA624D-1539-49DB-818B-4E8891EBAFBE/rect] with no body
[debug] [JSONWP Proxy] Got response with status 200: “{\n "value" : {\n "y" : 24,\n "x" : 66,\n "width" : 232,\n "height" : 52\n },\n "sessionId" : "858F3407-B678-4BC5-AF12-FAF8BD676D0C",\n "status" : 0\n}”
[debug] [JSONWP Proxy] Proxying [GET /element/D279DC52-7AC2-4302-93D5-CF7CA515E9EE/rect] to [GET http://localhost:8100/session/858F3407-B678-4BC5-AF12-FAF8BD676D0C/element/D279DC52-7AC2-4302-93D5-CF7CA515E9EE/rect] with no body
[debug] [JSONWP Proxy] Got response with status 200: “{\n "value" : {\n "y" : 1220,\n "x" : 0,\n "width" : 375,\n "height" : 122\n },\n "sessionId" : "858F3407-B678-4BC5-AF12-FAF8BD676D0C",\n "status" : 0\n}”
[debug] [JSONWP Proxy] Proxying [POST /uiaTarget/0/dragfromtoforduration] to [POST http://localhost:8100/session/858F3407-B678-4BC5-AF12-FAF8BD676D0C/uiaTarget/0/dragfromtoforduration] with body: {“fromX”:182,“fromY”:50,“toX”:187.5,“toY”:1281,“duration”:0.01}

and nothing happens further. Appium just waiting for something

if i try use

touch.press(el1).move_to(el2).wait(10).release().perform()

i got

[debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“y”:null,“x”:null,“element”:“1CF94FFC-183C-4457-B9CA-631E57F87731”}},{“action”:“moveTo”,“options”:{“y”:null,“x”:null,“element”:“7E2C056E-64BA-47D2-93A0-6F2C0A0368BA”}},{“action”:“wait”,“options”:{“ms”:100}},{“action”:“release”,“options”:{}}],“4832057e-172d-40f1-8a31-eadcf10a63d5”]
[debug] [XCUITest] Executing command ‘performTouch’
[debug] [XCUITest] Received the following touch action: press-moveTo-wait-release
[HTTP] ← POST /wd/hub/session/4832057e-172d-40f1-8a31-eadcf10a63d5/touch/perform 501 12 ms - 164
[HTTP] → DELETE /wd/hub/session/4832057e-172d-40f1-8a31-eadcf10a63d5 {}
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: [“4832057e-172d-40f1-8a31-eadcf10a63d5”]

same on Android

i have zero problem with java client. look like problem is in you python client :-). try add issue into tracker.

also with android you can enable in debug menu to see touches. and see where actually tap or swipe happens - this helps while investigating.

2 Likes

Can you please clarify if above 2 methods still working with latest version of Java client ?

As I’m getting error

MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/83ce4a90-d6d5-4f62-bb6b-d83b3b469739/element/0.4215224883376729-4/click] to [POST http://127.0.0.1:8000/wd/hub/session/43491d907cd4252d2d647da17ab3b83b/element/0.4215224883376729-4/click] with body: {“id”:“0.4215224883376729-4”}
[debug] [JSONWP Proxy] Got response with status 200: {“sessionId”:“43491d907cd4252d2d647da17ab3b83b”,“status”:0,“value”:null}
[JSONWP Proxy] Replacing sessionId 43491d907cd4252d2d647da17ab3b83b with 83ce4a90-d6d5-4f62-bb6b-d83b3b469739
[HTTP] <-- POST /wd/hub/session/83ce4a90-d6d5-4f62-bb6b-d83b3b469739/element/0.4215224883376729-4/click 200 571 ms - 76
[HTTP] --> POST /wd/hub/session/83ce4a90-d6d5-4f62-bb6b-d83b3b469739/touch/perform {“actions”:[{“action”:“press”,“options”:{“x”:100,“y”:100}},{“action”:“wait”,“options”:{“ms”:50}},{“action”:“release”,“options”:{}}]}
[debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“x”:100,“y”:100}},{“action”:“wait”,“options”:{“ms”:50}},{“action”:“release”,“options”:{}}],“83ce4a90-d6d5-4f62-bb6b-d83b3b469739”]
[HTTP] <-- POST /wd/hub/session/83ce4a90-d6d5-4f62-bb6b-d83b3b469739/touch/perform 501 15 ms - 122

@VikramVI do not have problem with latest appium and latest beta java-client:

public boolean tapElement(int x, int y) {
        try {
            new TouchAction((MobileDriver) driver).tap(x, y).perform();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
1 Like

My bad, I missed explicitly setting context back to native app, after doing action on chrome browser.

Thanks for your time. I’ll update ticket as well.

Regards,
Vikram

I am having similar issue here, can anyone help. I am using latest appium version 1.6.5

1 Like

May be this video help to resolve ur query : https://youtu.be/zqjEXembEos?list=PLXbcghgSZDroz9nez1IrbL2hnMVJ0ba1W

Had a similar problem and was about to give up on Appium until I saw this post on SO - https://stackoverflow.com/a/46587463. The author literally saved my week!