the problem as the title.
+1
A:
You should get the value of "font-weight" CSS property. In IE the bold value is "700" while in Firefox it will be "bold".
You need to get the computed style (FF) or current style (IE) of the element.
So for IE you will need to execute the following (it is in Java):
String strBold = selenium.getEval("var el = this.browserbot.findElement(<locator>);bold = el.currentStyle.fontWeight;");
boolean bold = "700".equals(strBold);
For the Firefox:
String strBold = selenium.getEval("var el = this.browserbot.findElement(<locator>);bold = window.document.defaultView.getComputedStyle(el,null).getPropertyValue('font-weight');");
boolean bold = "bold".equals(strBold);
ZloiAdun
2010-07-15 08:49:07
And to get other font attributes use "font-family", "font-size", "font-style", "font-variant"
ZloiAdun
2010-07-15 08:50:19
Thanks for your help, it was very useful for me.
david-shang
2010-07-21 06:45:05
Maybe you can mark answer as accepted? :)
ZloiAdun
2010-07-21 08:08:23
how to mark answer as accepted??? i am sorry, not be familiar with this.
david-shang
2010-07-22 05:52:53
I have no idea either - I have not asked any questions yet :)It's ok, leave as it is or vote up :)
ZloiAdun
2010-07-22 08:15:05