/// <summary> /// Get the text from the provided field ID /// </summary> /// <param name="fieldID"></param> /// <returns></returns> public string GetText(string fieldID) { string text; try { text = selenium.GetText(fieldID); return(text); } catch// (Exception) { ErrorReport(fieldID, CheckType.Warning); return(null); } }
/// <summary> /// Check to see if the value is correct within the field. If not it will return false. /// </summary> /// <param name="instancedriver">The current web driver.</param> /// <param name="fieldID">The field ID to check.</param> /// <param name="expectedtext">The expected text in string value. Must be exact.</param> /// <returns></returns> public virtual void ValuePresent(string fieldID, string expectedtext) { if (IDPresent(fieldID)) { if (selenium.GetText(fieldID).Contains(expectedtext)) { passedcheck++; } else { expected = expectedtext; error += "\n Test: " + id + ": " + fieldID + " value check returned false. " + expectedtext + " expected. Actual is " + selenium.GetText(fieldID); verificationErrors.Append("Test: " + id + " " + fieldID + " value check returned false. " + expectedtext + " expected. Actual is " + selenium.GetText(fieldID)); failedcheck++; } } }