Try these below, I don't know whether they are you want or not:
ie.#{element}(:id, "foo").document.currentstyle.attributeAsCamelCase
so
ie.#{element}(:id, "foo").document.currentstyle.fontFamily
ie.#{element}(:id, "foo").document.currentstyle.fontSize
ie.#{element}(:id, "foo").document.currentstyle.color
Sometimes you have to use invoke:
ie.#{element}(:id,"foo").document.currentstyle.invoke(attributeAsCamelCase)
the visible method works this way:
ie.#{element}(:id,"foo").document.currentstyle.invoke("display")
ie.#{element}(:id,"foo").document.currentstyle.invoke("isDisabled")
Find the list of available methods:
ie.#{element}(:id, "foo").document.currentstyle.ole_methods
#puts ie.div(:class,/Topbackgroud TopFont/).document.currentstyle.fontSize
#puts ie.div(:class,/Topbackgroud TopFont/).document.currentstyle.color
#puts ie.div(:class,/Topbackgroud
TopFont/).document.currentstyle.backGroundColor
#puts ie.div(:class,/Topbackgroud
TopFont/).document.currentstyle.scrollbarBaseColor
Wesley.
For life, the easier, the better.
2010/2/1 de Villamil Frédéric <[email protected]>
>
> Le 1 févr. 2010 à 12:06, Yuping Zhong a écrit :
>
> > Hi,
> >
> > I want to use the watir to verify the color for some cells that are in
> the table.
> >
> > Do watir have this function.If so,how to do that?
> >
> > Many thanks!
> >
> > -Zhong
> >
> >
>
> Hello,
>
> It depends on how the color is applied to the cell. But I guess checking
> for the style attribute or the class name should do it. However, Watir can't
> tell you what color is actually displayed on the screen.
>
> Regards,
> Frédéric
>
> --
> Frédéric de Villamil
> "What's mine is mine. What's yours is still unsetteled" – Go player proverb
> [email protected] tel: +33 (0)6 62 19 1337
> http://t37.net Typo :
> http://typosphere.org
>
> --
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To post to this group, send email to [email protected]
> Before posting, please read the following guidelines:
> http://wiki.openqa.org/display/WTR/Support
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/watir-general
>
--
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general