public void Clear() { WebElement.SendKeys(""); string messagePassed = $"The (Text Field) [ {ControlName} ] was Clear - CORRECT -."; string messageFailed = $"The (Text Field) [ {ControlName} ] was not Clear - WRONG -."; ExceptionManager.AssertAreEqual("", WebElement.Text, messagePassed, messageFailed); }
public void ValidateTextFieldValue(string expectedValue) { string text = GetValue(); string messagePassed = $"The (Text Field) [ {ControlName} ] contains the CORRECT value: [ {expectedValue} ]."; string messageFailed = $"The (Text Field) [ {ControlName} ] contains the WRONG value: [ {text} ], when it should contain the expected value: [ {expectedValue} ]."; ExceptionManager.AssertAreEqual(expectedValue, text, messagePassed, messageFailed); }
public void ValidateSpan(string expectedValue) { string text = WebElement.Text; string messagePassed = $"The (Span) [ {ControlName} ] contains the CORRECT value: [ {expectedValue} ]"; string messageFailed = $"The (Span) [ {ControlName} ] contains the WRONG value: [ {text} ], when it should contain the expected value: [ {expectedValue} ]"; ExceptionManager.AssertAreEqual(expectedValue, text, messagePassed, messageFailed); }
/// <summary> /// Validate that text of a hyperlink /// </summary> /// <param name="expectedValue"></param> public void ValidateLinkTextValue(string expectedValue) { var actualText = WebElement.Text; string messagePassed = $"The (Hyperlink) [ {ControlName} ] contains the CORRECT value: [ {expectedValue} ]"; string messageFailed = $"The (Hyperlink) [ {ControlName} ] contains the WRONG value: [ {actualText} ], when it should contain the expected value: [ {expectedValue} ]"; ExceptionManager.AssertAreEqual(expectedValue, actualText, messagePassed, messageFailed); }
public static void HandlerModalDialogsAndValidateText(string expectedMessage) { try { WaitForAlert(GetWebDriver); var alert = GetWebDriver.SwitchTo().Alert(); var alertMessage = alert.Text; var messageFailed = "The information message in Handler Modal dialog is not the expected [" + expectedMessage + "]."; var messagePassed = "The information message in Handler Modal dialog is correct."; ExceptionManager.AssertAreEqual(alertMessage, expectedMessage, messagePassed, messageFailed); alert.Accept(); BrowserSleep(); } catch (Exception) { SwitchToDefaultContent(); } }