Lock the screen through the Application under test.
find text element
List<WebElement> textfields = driver.findElementsByClassName("android.widget.EditText");
try{
for (int i = 0; i < textfields.size(); i++){
WebElement input = textfields.get(i);
input.sendKeys(password);
}
But text fields returning empty. If i manually enter some key then the password text is shown and the above code works.
How to enter the password?
FYI, i am sharing the HTC screens:
HTCONE_ScreenLock_Page_not_showing_textbox.png (The screen do NOT show the text box until we click some number in keyboard)
HTCONE_ScreenLock_passwordentry.png (if this screen appears the above code works, but how to come to this screen?).
Thanks Jonahss for the reply. The send info is not happening since it is not finding the text field unless some number is typed on it. (Please see the snapshots attached in above discussion).
I tried with unlock_apk command, i see this screen HTCONE_ScreenLock_Page_not_showing_textbox.png only .
The device is not getting unlocked.
Jlipps,
in my usecase the password has to be already set.
We need to find a way how to unlock the screen (How to enter the password if the screen is locked).
From a ‘just looking at the problem and not having done it myself’ perspective - I’d try a series of specific ‘blind’ touches that happen to correspond to the positions of the number sequence. (and then hit enter, of course)
This would actually emulate what the user would do - as opposed to loading a series of numeric values through ‘the side door’ as it were. From a QA perspective that might be a more authoritative strategy, even if it’s more difficult to read in the code (and may be brittle - if the code is changed the test will break).
The main problem is using secure network by key where you couldn’t use mobile without pin/pass code. For Nexus4 I got the unlock app working, but for Note3 - nope:-(
Of course, I did workaround by adb…But got it in the box of unlock.apk will be much better