I also ran into this yesterday. There was talk in http://rubyforge.org/pipermail/wtr-development/2012-February/003541.html about fixing watir-classic to be the same. Though it looks like it was not implemented.
I think all you would need to do for watir-classic is change the style method to: # return the css style as a string def style(property = nil) assert_exists if property ole_object.currentStyle.send(property) else ole_object.style.cssText end end It would make watir-classic similar to watir-webdriver. Though I think you would get different formats for some of the properties (example 'color'). Justin Ko On Friday, October 26, 2012 6:26:53 AM UTC-4, Connor C wrote: > > Hey Jarmo or whoever else can help :), > > In the latest wair-classic the Element#style() method works as follows > > # return the css style as a string > def style > assert_exists > ole_object.style.cssText > end > > > but it still doesn't behave like the webdriver version (which takes a > property argument). > > def style(property = nil) > if property > assert_exists > @element.style property > else > attribute_value("style").to_s.strip > end > end > > > It would be really useful if the watir-classic behaviour matched the web > driver version. Are there any plans to update this in the future or is > there a specfic reason they are different? > > Thanks thanks thanks, > Connor > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com