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.

[1.3.0-beta1] target.frontMostApp().keyboard() failed to tap with iOS7.1 and Xcode6

See original GitHub issue

When I tried to send_keys, then the following error cause. The error of target.frontMostApp().keyboard() is known one ?

info: [debug] Responding to client with error: {"status":17,"value":{"message":"An error occurred while executing user supplied JavaScript.","origValue":"target.frontMostApp().keyboard() failed to tap 'q'"},"sessionId":"cb171270-b361-4f6c-ae67-02f9a04f9f3c"}
  • Test case
require 'appium_lib'  #4.1.0

....

first_ele('UIATextField').send_keys 'qa@example.com'
  • capabilities
    • automationName: ‘Appium’
    • platformName: :ios
    • platformVersion: ‘7.1’
    • deviceName: ‘iPhone 5s’
    • app: APP_PATH_IOS
  • options for Appium server
    • --language ja
  • Logs
info: [debug] [INST] 2014-09-25 21:45:07 +0000 Debug: Running system command #12: /usr/local/Cellar/nvm/0.2.0/v0.11.11/bin/node /Users/user/Documents/github/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":"クックパッド","label":"クックパッド","value":null,"dom":null...
info: [debug] Socket data received (7750 bytes)
info: [debug] Socket data received (4716 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":"クックパッド","label":"クックパッド","value":null,"dom":null,"enabled":true,"valid":true,"visible":true,"hint":null,"path":"/0","x":0,"y":20,"width":320,"height":548},">":[{"UIAWindow":{"@":{"name":null,"labe
info: [debug] Pushing command to appium work queue: "au.getElementByIndexPath('/0/0/1/0/0')"
info: [debug] Sending command to instruments: au.getElementByIndexPath('/0/0/1/0/0')
info: [debug] [INST] 2014-09-25 21:45:08 +0000 Debug: Got new command 12 from instruments: au.getElementByIndexPath('/0/0/1/0/0')
info: [debug] [INST] 2014-09-25 21:45:08 +0000 Debug: evaluating au.getElementByIndexPath('/0/0/1/0/0')
info: [debug] [INST] 2014-09-25 21:45:08 +0000 Debug: evaluation finished
info: [debug] [INST] 2014-09-25 21:45:08 +0000 Debug: responding with:
info: [debug] [INST] 2014-09-25 21:45:08 +0000 Debug: Running system command #13: /usr/local/Cellar/nvm/0.2.0/v0.11.11/bin/node /Users/user/Documents/github/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"3"}}...
info: [debug] Socket data received (38 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":{"ELEMENT":"3"}}
info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"3"},"sessionId":"cb171270-b361-4f6c-ae67-02f9a04f9f3c"}
info: <-- POST /wd/hub/session/cb171270-b361-4f6c-ae67-02f9a04f9f3c/element 200 2981.065 ms - 87 {"status":0,"value":{"ELEMENT":"3"},"sessionId":"cb171270-b361-4f6c-ae67-02f9a04f9f3c"}
info: --> POST /wd/hub/session/cb171270-b361-4f6c-ae67-02f9a04f9f3c/element/3/value {"value":["qa@example.com"]}
info: [debug] Pushing command to appium work queue: "au.getElement('3').setValueByType('qa@example.com')"
info: [debug] Sending command to instruments: au.getElement('3').setValueByType('qa@example.com')
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: Got new command 13 from instruments: au.getElement('3').setValueByType('qa@example.com')
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: evaluating au.getElement('3').setValueByType('qa@example.com')
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: target.frontMostApp().keyboard().typeString("q")
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: target.frontMostApp().keyboard() failed to tap 'q'
info: [debug] [INST STDERR] 2014-09-26 06:45:09.368 ScriptAgent[23435:2f07] Log written to /Users/user/Library/Developer/CoreSimulator/Devices/0CEB836F-1261-4774-943D-E8FBD90533E7/data/Library/Logs/CrashReporter/UIALogs/ScriptError-2014-09-26-064509.plist

info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: Error typing 'q': VerboseError: target.frontMostApp().keyboard() failed to tap 'q'
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: Retrying...
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: target.frontMostApp().keyboard().typeString("q")
info: [debug] [INST STDERR] 2014-09-26 06:45:09.914 ScriptAgent[23435:2f07] Log written to /Users/user/Library/Developer/CoreSimulator/Devices/0CEB836F-1261-4774-943D-E8FBD90533E7/data/Library/Logs/CrashReporter/UIALogs/ScriptError-2014-09-26-064509.plist

info: [debug] [INST] 2014-09-25 21:45:09 +0000 Debug: target.frontMostApp().keyboard() failed to tap 'q'
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Error: VerboseError: target.frontMostApp().keyboard() failed to tap 'q'
info: [debug] Socket data received (76 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":17,"value":"target.frontMostApp().keyboard() failed to tap 'q'"}
info: [debug] Responding to client with error: {"status":17,"value":{"message":"An error occurred while executing user supplied JavaScript.","origValue":"target.frontMostApp().keyboard() failed to tap 'q'"},"sessionId":"cb171270-b361-4f6c-ae67-02f9a04f9f3c"}
info: <-- POST /wd/hub/session/cb171270-b361-4f6c-ae67-02f9a04f9f3c/element/3/value 500 1889.463 ms - 211
info: --> DELETE /wd/hub/session/cb171270-b361-4f6c-ae67-02f9a04f9f3c {}
info: Shutting down appium session
info: [debug] Stopping ios
info: [debug] Destroying instruments client socket.
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Sending sigterm to instruments
info: [debug] [INST] 2014-09-25 21:45:10 +0000 Stopped: Script was stopped by the user
info: [debug] [INST] 2014-09-25 21:45:09 +0000 Error: Error during eval: typeString@[native code]
       sendKeysToActiveElement@file:///Users/user/Documents/github/appium/C4F21A22-EE99-4170-ADD2-7D2E8FD223D3/bootstrap-d2800049d90e9851.js:1265:32
setValueByType@file:///Users/user/Documents/github/appium/C4F21A22-EE99-4170-ADD2-7D2E8FD223D3/bootstrap-d2800049d90e9851.js:1955:38
eval code
eval@[native code]
startProcessing@file:///Users/user/Documents/github/appium/C4F21A22-EE99-4170-ADD2-7D2E8FD223D3/bootstrap-d2800049d90e9851.js:2646:30
bootstrap@file:///Users/user/Documents/github/appium/C4F21A22-EE99-4170-ADD2-7D2E8FD223D3/bootstrap-d2800049d90e9851.js:2712:31
info: [debug] [INST] global code@file:///Users/user/Documents/github/appium/C4F21A22-EE99-4170-ADD2-7D2E8FD223D3/bootstrap-d2800049d90e9851.js:2721:10
       2014-09-25 21:45:09 +0000 Debug: responding with:
2014-09-25 21:45:09 +0000 Debug: Running system command #14: /usr/local/Cellar/nvm/0.2.0/v0.11.11/bin/node /Users/user/Documents/github/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":17,"value":"target.frontMostApp().keyboard() failed to tap 'q'"}...
info: [debug] [INST] Instruments Trace Complete (Duration : 47.222343s; Output : /tmp/appium-instruments/instrumentscli0.trace)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
KazuCocoacommented, Sep 28, 2014

Thanks for your comment. When I changes keyboard setting of iOS Simulator, I could command send_keys.

What I did was …

  • Launch iOS Simulator and uncheck the following option.
    • iOS Simulator-> Hardware-> Keyboard -> Connect Hardware Keyboard
0reactions
lock[bot]commented, May 1, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

target.frontMostApp().keyboard() failed to locate key 'N'
I'm trying to automate keyboard typing with UI Automation. target.frontMostApp().keyboard().typeString("INTERCOM"). But i will get this error after first ' ...
Read more >
xcode第三方控件库- OSCHINA - 中文开源技术交流社区
1 、打开iOS项目 如果你当前目录下既有project又有workspace,你可以在终端使用命令“xed.”自动打开workspace,如果只有project,它会自动打开project。
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