How to Using Webdriver Selenium to get the value of “style” element

后端 未结 3 1999
醉酒成梦
醉酒成梦 2020-12-06 02:32

I want to check whether the value of a style element is greater than a particular value (i.e., is left > 666px ?), but I am unable to get ahold of the value.

Here is

3条回答
  •  情书的邮戳
    2020-12-06 02:58

    You may capture the Computed Css value as shown in the firebug screenshot below:

    enter image description here

    like this:

    WebDriver web = new FirefoxDriver(;
    String visibility = web.findElement(By.xpath("//your xpath")).getCssValue("display");
    

提交回复
热议问题