/// <summary> /// Enter text into a TextBox using keyboard and then verify. /// Always try to use this method instead of SetValue() because this a closer /// implementation to how a user would normally set the value of a TextBox. /// </summary> /// <param name="text">Text to enter</param> /// <param name="shouldVerify">Indicate whether or not to verify</param> public void EnterText(string text, bool shouldVerify = true) { ReportActionValue("EnterText", text); UIItem.Enter(text); WaitForTextInput(text.Length); CaptureImage(); if (shouldVerify) { var friendlyMessage = ConstructFriendlyMessage(Resources.FriendlyTextBoxSetMsg, text); QAAssert.AreEqual(text, UIItem.Text, friendlyMessage); } }
/// <summary> /// Enter text into a ComboBox using keyboard and then verify. /// </summary> /// <param name="text">Text to enter</param> public void EnterText(string text) { try { ReportActionValue("EnterText", text); UIItem.Enter(text); CaptureImage(); } catch (Exception ex) { var friendlyMessage = ConstructFriendlyMessage(Resources.FriendlyComboBoxNotEditable); Report.Output(Report.Level.Debug, friendlyMessage, ex); } }