'WebDriver' object has no attribute 'press_keycode'

Hi there. I’m simply trying to dismiss the keyboard on Android. The code is split across different classes, but here is the jist:

Driver setup:

self.driver = webdriver.Remote(
“platformName”: “Android”,
“deviceName”: “Galaxy S6 Edge”,
“noReset”: False,
“app”: “/Users/xxx.xxx/Documents/Automation/apps/app-release.apk”,
“automationName”: “UiAutomator2”

Function call:



AttributeError: ‘WebDriver’ object has no attribute ‘press_keycode’

The same result happens for


I’m also not able to scroll/swipe within the app either. It says the ‘method is not implemented’. I’ve worked on several projects and these types of commands have been really straightforward and easy to use. I have no idea what is going wrong.

It seems like I’m able to perfectly interact with the application elements but not the Android device itself.

Problem found. I was using:

from selenium import webdriver

instead of:

from appium import webdriver