/// <summary> /// Checks for validation errors after invoice is saved /// </summary> public bool CheckForValidationError(Sales salesObject, string nameOfValidationError) { HtmlDiv validationErrorDiv = salesObject.SelectDivOnPage("notify01"); var validationErrorCustomControl = validationErrorDiv.GetChildren(); HtmlDiv currentValidationError = null; //loop throught the notification div to find if error exists foreach (var currentError in validationErrorCustomControl) { if (currentError.FriendlyName.Contains(nameOfValidationError)) { currentValidationError = (HtmlDiv)currentError; } } //check if div is present if (currentValidationError != null) { return true; } else { Assert.Fail("Validation box not thrown up"); } return false; }