来个元素CSS值
代码1:
通过javaScript执行脚本获取css值
String jsStr = "return document.getElementById(\"buyers\").style.getPropertyValue('width')";
Object o = ((JavascriptExecutor) driver).executeScript(jsStr);
System.out.println(o.toString());
代码2:
通过内置API获取元素属性值
//获取元素属性值
WebElement element=page.Buyers;
String original_style = element.getAttribute("style");
System.out.println(original_style);