private void EnterPassword() { UiSelector passwordSelector = new UiSelector().ResourceId("password"); string passwordtext = _controller.GetText(passwordSelector); if (string.IsNullOrEmpty(passwordtext)) { OnStatusUpdate("Enter password."); if (!_controller.SetText(passwordSelector, Credential.Password)) { throw new DeviceWorkflowException("Failed to enter password."); } } //Get rid of the keyboard if present if (_controller.IsVirtualKeyboardShown().Value) { _controller.PressKey(KeyCode.KEYCODE_ESCAPE); } }