Unlocking the device using pattern lock capabilities not working in my Android 10 VIVO Z1 Pro device

I tried using the capability of unlockType and unlockKey in Android 10 OS device. But I am getting the exception Noelement exception since I have added my parameters correctly.

cap.setCapability(“unlockType”, “pattern”); //Trying to unlock the device using pin or pattern
cap.setCapability(“unlockKey”, “7586”);

Can anyone provide solution for it

Satish, Hi, welcome.

Which devices/environments does your automation of lockscreen work on?

“What” feature exactly is it that you are automated-testing? Is your company building an app that provides a lockscreen-app? Regardless, please configure your device to NOT lock. If you are testing a lock-screen app, then just don’t use automation tools to test it, get the developer to give you a “hook” to internally unlock the lockscreen-app. Thiscan be doen using a TCP listener for example. Sorry, but this kind of “checking” is best NOT done using automation tools. It’s a minefield and you will waste a lot of your companies time on it if you go there. Test lockscreens manually if you have to, if not, disable it.

It’s not “functionality” in 99% of use-cases. If you really still have to “unlock”, have a look at this thread just a few lines down on the page. How to unlock the pattern locked device through appium?