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(
command_executor=‘http://127.0.0.1:4723/wd/hub’,
desired_capabilities={
“platformName”: “Android”,
“deviceName”: “Galaxy S6 Edge”,
“noReset”: False,
“app”: “/Users/xxx.xxx/Documents/Automation/apps/app-release.apk”,
“automationName”: “UiAutomator2”
})
Function call:
self.driver.press_keycode(4)
Result:
AttributeError: ‘WebDriver’ object has no attribute ‘press_keycode’
The same result happens for
self.driver.hide_keyboard()
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.