Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

the problem as the title.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
136 views
Welcome To Ask or Share your Answers For Others

1 Answer

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...