How to Measure Font Size with a Ruler: Tips for Web Application Validation

Welcome to Automation Step by Step’s Q and A Friday episode. Today, we’re answering a question from Akash who wants to know how to check the font size in a web application. Whether asked for the requirement or not, measuring font size is essential for web application validation.

There are two easy ways to check font size on any web application. One of the straightforward ways is to right-click on any web element on your browser and choose “Inspect Element.” This will open a window where you can view the CSS and see the font size or any other design that you want to validate.

Another way is to use a Chrome extension like What Font or CSS Viewer. What Font is a plugin that you can add to your Chrome browser to see the font name and other font details. CSS Viewer is another extension that gives you all the details of the design, font, text, color, and background of a particular element.

If you already have a Selenium framework, you can add a validation of font checking inside your automation framework. In Selenium, the function you need is called Get CSS Value. If you give the option font size, it will get the font size of that particular element, and then you can do your validations over there.

In conclusion, measuring font size is essential for web application validation. You can use either the browser’s inspect element feature or Chrome extensions like What Font or CSS Viewer. If you have a Selenium framework, you can add font checking to your automation framework using the Get CSS Value function.

Let us know your favorite way of measuring font size or any other tips you have for web application validation in the comments section. And if you have any other questions, please let us know by sending an email at Ask.QnAfriday.gmail.com or mentioning your queries in the comment section.

Thank you for reading!