The mobile device screen can able to locked programmatically. Appium provides a method through which we can perform the same.
lockScreen(int seconds)
The argument should be an integer value ie the number of seconds we want the screen to be in locked state.
Suppose we want the mobile device to be in locked state for 10 seconds then we can use the above method in the following way:
//Configure the desired capablilites of the mobile device
driver.lockScreen(10);
On executing the above code, screen will be locked for 10 secs and we cannot perform any action on the screen for 10 and after 10 seconds the screen will be unlocked.
0 Comment(s)