Is it possible to verify Bootstrap's constraint validation text with Robot Framework?

I am working as a practical trainee doing Robot Framework UI-tests. With one test case the idea is to provide a password to site’s login form but leave username-field as empty. Then when Sign In-button is clicked there comes text “Please fill in this field” regarding empty username-field and that text only shows for couple of seconds before disappearing. The idea would be to verify that text after Sign In is clicked.

I tried to find that “Please fill in this field”-text inspecting login form with Google Chrome and looking at web site’s source code but could not find that text anywhere from HTML site structure or JavaScript-files. I talked with a developer and he said that this text is provided by Bootstrap’s validating. I then found on google that this validating functionality is called constraint validation and required> part in code is what adds that functionality.

Unfortunately I can’t put a direct link to the site that I am testing as the site is on a test server only accessible by some computers and not in production but that site is build with angular and for example username-part is ng-model=”login_username” when inspecting.

So my question is that when I can not point to that “Please fill in this field” text by xpath is there any other way to verify that this text indeed exists by using Robot Framework? I guess that maybe with JavaScript added to Robot-code that could be done but an example would help a lot if someone has done a test like that before. I have not a lot of experience of Robot/JavaScript-combination yet as I have started to study Robot earlier this year.

In a link below in “Text Input”-image there is exactly the same popup shown that I am getting when providing only password and clicking Sign In. So if I understood correctly that is a standard validation provided by Bootstrap.

146 thoughts on “Is it possible to verify Bootstrap's constraint validation text with Robot Framework?”

Leave a Comment