Bogdan, I sent you a direct message by mistake last time so sorry for
the duplicate but I'd like to post the question publicly.
** Goal **
the goal is to read the css color attribute for an image thumbnail
with the image id=thumbnail:1
** Source **
String script =
" {" +
" var x = window.document.getElementById('thumbnail:1');" +
"
window.document.defaultView.getComputedStyle(x,null).getPropertyValue('border');"
+
"}";
String result = selenium.getEval(script);
** Result **
The result is blank although the firebug shows the border=1px solid
black.
** Alternate **
The following are other javascript queries I've tried with the same
empty responce.
1. selenium.getEval("window.document.getElementById('thumbnail:
1').style.border");
2.
selenium.getEval("window.document.defaultView.getComputedStyle(document.getElementById('thumbnail:
1'), null).backgroundColor");
3. String thumbStyle =
selenium.getEval("window.document.getElementById('thumbnail:
1').style");
Note:
selenium.getEval("window.document.defaultView.getComputedStyle(document.getElementById('thumbnail:
1') returns "[object HTMLImageElement]"
Thank you in advance for your time.
On Feb 21, 11:06 am, Bogdan <
bolchisbolc...@gmail.com> wrote:
> Turns out I should have used:
>
> string script = "var x =
> window.document.getElementById('__ELEMENT_ID_HERE__');
> window.document.defaultView.getComputedStyle(x,null).getPropertyValue('__CO MPUTED_CSS_ATTR_HERE__');";