如何在机器人框架中验证背景图像

问题描述 投票:0回答:1

我需要你的帮助

我想知道是否有键盘来确认 DOM 中是否有背景图像,或者是否可以在控制台中显示一些消息,就好像有背景图像说 TRUE 一样。

背景图片在header里,不在div里

背景图片:url(/wp-content/uploads/slider_03-1.jpg);

谢谢!

javascript selenium-webdriver dom robotframework background-image
1个回答
0
投票

您可以使用 CSS 选择器并测试此 DIV 是否存在。

div.section[style*='background-image:url(/wp-content/uploads/MainBack-1.jpg);']
^ a DIV
   ^ that has the class "section"
           ^ that also contains as part of the style the "background-image..." path

这是为页面主要部分提供背景图像的 DIV。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.