How to get element color with Selenium

前端 未结 4 1827
走了就别回头了
走了就别回头了 2020-12-18 00:34

I want to check the color of an element in an html page. The color of this element is set with a javascript, look at the image

The element with div-id \"Ab_banco_M

4条回答
  •  没有蜡笔的小新
    2020-12-18 01:11

    With XPath you can try to search by attribute. For example //div[@style='background: red']. If you want to get color then for CSS I would use method getCSSValue()

提交回复
热议问题