Hi everyone, I am using robot framework, specifically AppiumLibrary library to test android application, however when I use keyword “Press Keycode” the following error message, help me to fix this error:
WebDriverException: Message: Unknown mobile command “pressKey”. Only shell,execEmuConsoleCommand,dragGesture,flingGesture,doubleClickGesture,longClickGesture,pinchCloseGesture,pinchOpenGesture,swipeGesture,scrollGesture,scrollBackTo,scroll,viewportScreenshot,viewportRect,deepLink,startLogs,Info gettroadcast,stopaccept DeviceTime,changePermissions,getPermissions,performEditorAction ,startScreenStreaming,stopScreenStreaming,getNotifications,listSms,type,sensorSet,deleteFile,clearApp,startActivity,startService,stopService,broadcast,getContexts,installMultipleApks commands are supported.
Stacktrace:
UnknownCommandError: Unknown mobile command “pressKey”. Only shell,execEmuConsoleCommand,dragGesture,flingGesture,doubleClickGesture,longClickGesture,pinchCloseGesture,pinchOpenGesture,swipeGesture,scrollGesture,scrollBackTo,scroll,viewportScreenshot,viewportRect,deepLink,startLogs,Info gettroadcast,stopaccept DeviceTime,changePermissions,getPermissions,performEditorAction ,startScreenStreaming,stopScreenStreaming,getNotifications,listSms,type,sensorSet,deleteFile,clearApp,startActivity,startService,stopService,broadcast,getContexts,installMultipleApks commands are supported.
at AndroidUiautomator2Driver.executeMobile (C:\Users\toannv\Downloads\A…
[ Message content over the limit has been removed. ]
…ules\appium\node_modules\appium-base-driver\lib\baseddriver\driver.js:335:9)
at C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\node_modules\async-lock\lib\index.js:146:12
at AsyncLock._promiseTry (C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\node_modules\async-lock\lib\index.js:280:31)
at exec (C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\node_modules\async-lock\lib\index.js:145:9)
at AsyncLock.acquire (C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\node_modules\async-lock\lib\index.js:162:3)
at AndroidUiautomator2Driver.executeCommand (C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\baseddriver\driver.js: 348:39)
at AppiumDriver.executeCommand (C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\lib\appium.js:563:36)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at asyncHandler (C:\Users\toannv\Downloads\Appium-Server-GUI-windows-1.22.0\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:297: 21)