We maintain an automation suite which the whole team knows how to execute.
An automated software tool for validating design patterns dating seven years not married
So I am not really checking that the box is indeed red, and not checking its location at all. When the validation fails, a new div element is introduced between the dt element and the label: that div has the class of “field-with-errors”. I can see that this class, as with the flash error above, is causing the label to go red. So it would probably go with something like: Ensuring to get the label I require, so in this instance the Username label.
So if this locator return an element, I know that the label is red. Then the final thing we can check is the contextual message.
But most have some method of validation on them and in my experience, checking this validation is something teams look to automate.
It makes sense: populate a few fields, or leave them empty, click submit, and ensure the correct validation is delivered by the site. Recently though, I was thinking about the form validation automation I have done in the past, and questioning its effectiveness.
If either the templates are stale, or people do not follow that because it is too rigid, eventually much of the relevant knowledge through testing procedure won't be reflected right.