About AndroidDriver.lockDevice()

@Priyank_Shah @wreed @pr4bh4sh
In latest version of Java_Client 3.4.0, method lockScreen(seconds) is deprecated and it is going to be removed in the next release. Currently am using lockScreen(seconds) method in my code; they suggested AndroidDriver.lockDevice() for lock device screen.

I am using AppiumDriver for my code.

Getting Error:
cannot be cast to io.appium.java_client.android.AndroidDriver

  1. Code snippet
  2. Full stack trace
  3. The issue is not related to Appium but JAVA programming

With current input it likely that
You are casting it wrong. Steps to identify what’s going wrong

  1. Download the source jar file
  2. Link it with the library you have
  3. Navigate to each class hierarchy to find out the classes and figure out with what class you can cast to the object you wish to cast.

PS. Don’t take it as offense but I think we all have asked you again and again to provide the complete detail and data, whenever you are asking a question.

3 Likes