UIAutomator2 fails to unlock screen
See original GitHub issueThe problem
When my screen lock type is set to pattern or a pin then the Appium is not able to unlock the screen.
Environment
- Appium version: 1.7.1
- Windows 7:
- Node.js version: v6.9.2
- Mobile platform/version: Android 7.0
- Real device: Samsung J5 2017 model
Link to Appium logs
https://gist.github.com/aaltat/1a825d83aa3343607c53bef56621a182
Details
When running the code below, I see this error:
Traceback (most recent call last):
File "tmp.py", line 12, in <module>
driver1 = webdriver.Remote(url, caps)
File "C:\PYTHON27\lib\site-packages\appium\webdriver\webdriver.py", line 36, in __init__
super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profil
e, proxy, keep_alive)
File "C:\PYTHON27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 151, i
n __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\PYTHON27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 240, i
n start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\PYTHON27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 308, i
n execute
self.error_handler.check_response(response)
File "C:\PYTHON27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194
, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
Code To Reproduce Issue [ Good To Have ]
import time
from appium import webdriver
url = 'http://localhost:4723/wd/hub'
caps = {"platformVersion": "7.0.0",
"appPackage": "com.android.settings",
"platformName": "android",
"appActivity": ".Settings",
"deviceName": "Samsung_J5",
"unlockType": "pattern",
"unlockKey": "1236"}
driver1 = webdriver.Remote(url, caps)
print driver1.session_id
driver1.quit()
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Developers - UIAutomator2 fails to unlock screen - - Bountysource
UIAutomator2 fails to unlock screen. ... The problem. When my screen lock type is set to pattern or a pin then the Appium...
Read more >Unlocking the device by Ui automator 2.0 - android
Is there any solution to unlock device using ui-automator? ... findObject(new UiSelector().description("Phone")); // test fails here ...
Read more >Uiautomator2 error - Cannot read property 'isScreenLocked' of ...
While running with automationName = Appium - test work fine, but instead of Appium I write uiautomator2, the error is this: [MJSONWP] ...
Read more >Write automated tests with UI Automator - Android Developers
The UI Automator testing framework provides a UiDevice class to access and perform operations on the device on which the target app is...
Read more >appium-uiautomator2-driver - npm
If the given value is too low then expect driver commands to fail with ... appium:skipUnlock, Whether to skip the check for lock...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vrunoa FYI
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.