operasoftware/operadriver — Issue #49: getCssValue() throws java.lang.NumberFormatException: For input string: "transparent"
Author: java-developer
Created: 2012-01-09 10:05:21+00:00
State: open

Hello,

I am getting an exception when I run this code (which works perfectly with FireFox and Chrome):

```
final ThreadLocal webDriver = new ThreadLocal();
final OperaDriver driver = new OperaDriver();
webDriver.set(driver);
final WebElement element = getWebDriver().findElement(By.cssSelector("xpath"));
return element.getCssValue("background-color");
```

Environment:

OS: OSX 10.7.2
Selenium: 2.15.0
OperaDriver: 0.8.1 / HEAD

StackTrace:

java.lang.NumberFormatException: For input string: "transparent"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.valueOf(Integer.java:582)
at com.opera.core.systems.model.OperaColor.(OperaColor.java:57)
at com.opera.core.systems.OperaWebElement.getCssValue(OperaWebElement.java:685)

I understand what is causing the exception but I believe that you should be handling it. Do you agree?

Thanks,

Craig