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.

UIAutomator2 fails to unlock screen

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mykola-mokhnachcommented, Nov 8, 2017

@vrunoa FYI

0reactions
lock[bot]commented, Jun 9, 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

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 >

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