-
-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver.lockScreen() not working as expected. #315
Comments
I will try to reproduce. But it can be the server-side problem. |
It is the server side problem. |
@TikhomirovSergey there's definitely some issue with the |
I'm searching for the cause of this problem. It is already reported probably. I've asked the question at team chat. |
Talking this over, this appears to be the desired behavior. The locking-waiting-unlocking is necessary for iOS, where it is the only way to do any locking. For Android it should just lock. If you want it to unlock, you can call unlock. I am making the seconds parameter optional, and documenting this difference. |
Quoting from SO-35223434-
We have called
driver.lockScreen(20);
in my test followed byRuntime.getRuntime().exec("adb shell input keyevent 26");
to unlock screen. But the problem is the device is not getting locked for 20 sec. The next statement keyevent 26 is unlocking the device as soon as device is locked. So why we are providing20 sec
parameter?Looking further into this, the AppiumDriver.java has this to say :
/** * Lock the device (bring it to the lock screen) for a given number of * seconds * * @param seconds * number of seconds to lock the screen for */ public void lockScreen(int seconds) { execute(LOCK, ImmutableMap.of("seconds", seconds)); }
The text was updated successfully, but these errors were encountered: