Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading… without parameters doesn't return style info #120

alisterscott opened this Issue · 5 comments

2 participants

Alister Scott Jari Bakken
Alister Scott

Example script:

require 'watir-webdriver'
b = Watir::Browser.start ''
puts b.div(:id => 'g1minesRemaining100s').style 'background-image'
puts b.div(:id => 'g1minesRemaining100s').style #shouldn't be ''

Jari Bakken

Right. If you give an argument, we'll return the computed style of the element, otherwise, the style attribute (which may very well be empty).

I'm not entirely sure if it's correct to change this.

Alister Scott

I guess what I was looking for is all computed styles of the element. But, it makes sense to not change this method from what it actually currently does.
I imagine it may be rather inefficient to compute all styles of an element?

Jari Bakken

Honestly don't know if it's inefficient, but I think it will be pretty difficult to make the returned string consistent cross-browser.

What's the use case? What would you do with the full list?

Alister Scott

Someone wanted it on stackoverflow.
They couldn't work out how to use the style method, as it returned an empty string.

I'm more than happy to close it and see if it comes up as a request again :)

Jari Bakken

OK, then that's what we'll do :)

Jari Bakken jarib closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.