Watir - working with CSS elements

I hope someone can help me by telling me that this is impossible to do or point me in the right direction.

I am trying to use Watir Ruby's written tests to test the CSS element that applies to my page when the checkbox is checked. I can check the checkbox attribute and see that it is checked, but to check the difference, I have to check if the image was selected after checking the checkbox.

Currently, I could not find anything useful after hours of searching. Has anyone encountered a problem that you must overcome, and if so, how did you do it.

Thanks in advance

+5
source share
2

Watir ( IE Windows), win32ole:

irb(main):001:0> require "watir"
=> true
irb(main):002:0> b = Watir::Browser.new
=> #<Watir::IE:0x4bce118 url="about:blank" title="">
irb(main):003:0> b.goto "google.com"
=> 2.298132
irb(main):004:0> i = b.image(:alt => "Google")
=> #<Watir::Image:0x433fa28 located=false how={:alt=>"Google"} what=nil>
irb(main):005:0> i.style
=> #<WIN32OLE:0x431ca90>
irb(main):008:0> i.style.paddingTop
=> "26px"

#style , . CSS, .

ole msdn http://msdn.microsoft.com/en-us/library/ms535870(v=vs.85).aspx .

+2

CSS ? class , , .

browser.image.class_name =~ /foobar/

, , , , HTML,

browser.image.html =~ /style=\"?foobar\"?/
+1

All Articles