private void LogIn(string username, string password) { AutomationElement mainWindow = GetMainLoginWindow(); var windowPattern = mainWindow.GetCurrentPattern(WindowPattern.Pattern) as WindowPattern; if (windowPattern != null) { windowPattern.SetWindowVisualState(WindowVisualState.Normal); } Debug.Write(string.Format("loggin in, username: {0}...", username)); mainWindow.SetValue(ControlType.ComboBox, "Skype Name", username); mainWindow.SetValue(ControlType.Edit, "Password", password); mainWindow.ButtonClick("Sign in"); }