In Selenium, how do I access the name of the "Rendered Fonts"?

Viewed 51

On the website I am trying to test, one of the fonts is not getting downloaded (it is blocked by the security) - and therefore, a substitute font is used. In the screenshot below, "Montserrat" font was blocked from being downloaded; and therefore "Times New Roman" was used - also shown in the screenshot).

enter image description here

The selenium Java call element.getCssValue("font-family") returns Montserrat, because it is 'preferred/intended' font. But in actuality the other font is used because Montserrat is not available.

I looking for help to see if there is a way to access the items in Rendered Fonts section. If there is an entry, I plan to throw an error (i.e. I expect nothing to be listed in Rendered Fonts section)

Thanks :)

0 Answers
Related