简体   繁体   English

Selenium RC中的BackGround颜色?

[英]BackGround Color in Selenium RC?

I am new to Selenium.i want to assert the Background color of particular Screen. 我是Selenium的新手。我想断言特定屏幕的背景色。 How to assert Background color using Selenium rc? 如何使用Selenium rc声明背景色?

You can get it by retrieving the background color from the body. 您可以通过从主体获取背景色来获得它。 Should be something like this: 应该是这样的:

WebElement body = driver.findElement(By.cssSelector("body"));
String color = body.getAttribute("bgcolor");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM