在硒中,我如何访问“渲染字体”的名称?
在我试图测试的网站上,其中一种字体没有下载(它被安全性阻止) - 因此,使用替代字体。在下面的屏幕截图中,“蒙特塞拉特”字体被阻止下载;因此,使用了“时代新罗马” - 也在屏幕截图中显示)。
selenium java调用element.getcssvalue(“ font-family”)
返回蒙特塞拉特(Montserrat),因为它是'首选/意图'字体。但是实际上,使用其他字体,因为蒙特塞拉特(Montserrat)不可用。
我寻求帮助,看看是否有一种方法可以访问渲染字体中的项目 。如果有条目,我计划丢下错误(即我希望在渲染字体部分中列出任何内容),
谢谢):)
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).
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 :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论