MCPcopy
hub / github.com/appium/python-client / unlock

Method unlock

appium/webdriver/extensions/hw_actions.py:49–63  ·  view source on GitHub ↗

Unlock the device. No changes are made if the device is already locked. Returns: Union['WebDriver', 'HardwareActions']: Self instance

(self)

Source from the content-addressed store, hash-verified

47 return self
48
49 def unlock(self) -> Self:
50 """Unlock the device. No changes are made if the device is already locked.
51
52 Returns:
53 Union['WebDriver', 'HardwareActions']: Self instance
54 """
55 ext_name = 'mobile: unlock'
56 try:
57 if not self.assert_extension_exists(ext_name).execute_script('mobile: isLocked'):
58 return self
59 self.execute_script(ext_name)
60 except UnknownMethodException:
61 # TODO: Remove the fallback
62 self.mark_extension_absence(ext_name).execute(Command.UNLOCK)
63 return self
64
65 def is_locked(self) -> bool:
66 """Checks whether the device is locked.

Callers 2

test_unlockMethod · 0.80
test_unlockMethod · 0.80

Calls 4

execute_scriptMethod · 0.80
executeMethod · 0.45

Tested by 2

test_unlockMethod · 0.64
test_unlockMethod · 0.64