在硒中,我如何访问“渲染字体”的名称?

发布于 2025-02-06 07:08:43 字数 502 浏览 3 评论 0原文

在我试图测试的网站上,其中一种字体没有下载(它被安全性阻止) - 因此,使用替代字体。在下面的屏幕截图中,“蒙特塞拉特”字体被阻止下载;因此,使用了“时代新罗马” - 也在屏幕截图中显示)。

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).

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 :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文