【问题标题】:font color using selenium java使用 selenium java 的字体颜色
【发布时间】:2015-08-17 04:39:28
【问题描述】:
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("https://news.google.co.in/nwshp?hl=en&tab=wn&ei=zJBuVe3MGYukuQTrlIDAAQ&ved=0CAUQqS4oBQ");
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);  
driver.findElement(By.id("gbqfq")).sendKeys("Veenita");
System.out.println("Font Size is "+ driver.findElement(By.id("gbqfq")).getCssValue("font-size"));
System.out.println("Font Color is "+driver.findElement(By.id("gbqfq")).getCssValue("font-color"));
System.out.println("Font Background Color is "+driver.findElement(By.id("gbqfq")).getCssValue("background-color"));
System.out.println("Font Type is "+driver.findElement(By.id("gbqfq")).getCssValue("font-type"));

O/P 是:

Font Size is 16px
Font Color is 
Font Background Color is transparent
Font Type is 

为什么没有从我的代码中检索字体颜色和字体类型?

【问题讨论】:

  • 因为字体类型不存在

标签: java selenium fonts colors


【解决方案1】:

使用colorfont-family 代替字体颜色和字体类型。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-15
    • 1970-01-01
    • 1970-01-01
    • 2011-06-01
    • 2014-03-11
    • 2014-02-17
    • 1970-01-01
    相关资源
    最近更新 更多