Skip to content

Can't use sendKeyEvent #7991

Closed
Closed
@bridgewaterrobbie

Description

@bridgewaterrobbie

The problem

Briefly describe the issue you are experiencing (or the feature you want to see added to Appium). Tell us what you were trying to do and what happened instead. Remember, this is not a place to ask questions. For that, go to http://discuss.appium.io!

Environment

Appium version (or git revision) that exhibits the issue: 1.6.4
Last Appium version that did not exhibit the issue (if applicable):
MacOS 10.12
Node.js version (unless using Appium.app|exe): 7.5
Mobile platform/version under test: Android 7.1.1
Real device or emulator/simulator: Real device (Pixel)
Appium CLI or Appium.app|exe: CLI

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

[HTTP] --> POST /wd/hub/session/fce62f7a-3da4-4f4f-9b82-ec494453c078/appium/device/keyevent {"keycode":33} [MJSONWP] Driver proxy active, passing request on via HTTP proxy [debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/fce62f7a-3da4-4f4f-9b82-ec494453c078/appium/device/keyevent] to [POST http://localhost:8200/wd/hub/session/a7728891-cde4-43d2-b528-44376fd4fb1a/appium/device/keyevent] with body: {"keycode":33} 
[MJSONWP] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - undefined at doJwpProxy$ (../../../lib/mjsonwp/mjsonwp.js:343:13) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) 
[HTTP] <-- POST /wd/hub/session/fce62f7a-3da4-4f4f-9b82-ec494453c078/appium/device/keyevent 500 114 ms - 274

Including here since it is pretty small.

Code To Reproduce Issue [ Good To Have ]

wd.sendKeyEvent(33);
Seems to happen regardless of what app is being automated.

Activity

added
Androidrelated to Android-native driver(s)
Buga problem that needs fixing
and removed
Needs Triagebugs which are not yet confirmed
on Mar 7, 2017
monkeyDledger

monkeyDledger commented on Jul 4, 2017

@monkeyDledger

I got the same problem.
I found code in appium-uiautomator2-server:
register(postHandler, new PressKeyCode("/wd/hub/session/:sessionId/appium/device/press_keycode"));
but not found:
register(postHandler, new PressKeyCode("/wd/hub/session/:sessionId/appium/device/keyevent"));
and keyevent in wd:
POST /session/:sessionId/appium/device/keyevent

added and removed
Buga problem that needs fixing
on Jul 5, 2017
mykola-mokhnach

mykola-mokhnach commented on Jul 5, 2017

@mykola-mokhnach
Collaborator

created issue report for WD project to update deprecated API call

jlipps

jlipps commented on Jul 6, 2017

@jlipps
Member

admc/wd#480 has been resolved, you should be able to use the new driver.pressKeycode function in wd@1.3.0

541347048

541347048 commented on Aug 1, 2017

@541347048

I update wd to 1.40, but i can not use keyevent also. please help

dariayakubovich

dariayakubovich commented on Dec 15, 2017

@dariayakubovich

I have the same issue, Can you help me? I use pressKeyCode
[debug] [JSONWP Proxy] Proxying [POST /appium/device/press_keycode] to [POST http://localhost:8200/wd/hub/session/d9889842-88fb-4c33-831e-45f8aaf59227/appium/device/press_keycode] with body: {"keycode":84,"metastate":null}
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.7.1","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 12 ms - 83
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"d9889842-88fb-4c33-831e-45f8aaf59227","status":0,"value":true}
[debug] [MJSONWP] Responding to client with driver.pressKeyCode() result: true
[HTTP] <-- POST /wd/hub/session/6f878e93-0f39-4b19-9773-cee3041295fb/appium/device/press_keycode 200 1604 ms - 76
[HTTP] --> GET /wd/hub/session/6f878e93-0f39-4b19-9773-cee3041295fb {}
[MJSONWP] Calling AppiumDriver.getSession() with args: ["6f878e93-0f39-4b19-9773-cee3041295fb"]

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidrelated to Android-native driver(s)ThirdPartyupstream problemsUIAutomator2specific to uiautomator2 driver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jlipps@bridgewaterrobbie@monkeyDledger@mykola-mokhnach@triager

        Issue actions

          Can't use sendKeyEvent · Issue #7991 · appium/appium