1
votes

How can I find an element using it's inline style declaration?

Here's my attempt:

results = browser.div(:id => 'summon_panel')
                 .div(:class => 'tabs2_container')
                 .div(:class => 'pane_inner', :index => 4)
                 .div(:class => 'pagination_tabs_container')
                 .div(:style => 'display: block') # This is what I've added.
                 .divs(:class => 'rank')

And result:

Watir::Exception::UnknownObjectException (unable to locate element, using {:style=>"display: block", :tag_name=>"div"}): app/controllers/streams_controller.rb:61:in `saveranks'

1
Is "display: block" the exact inline style on the element? - Matt Ball
@MattBall: Had to add that final semi-colon. ; - Thanks for the heads up! Write as answer and I'll mark it for you. - sergserg
It usually helps if you share relevant HTML. - Ċ½eljko Filipin

1 Answers

2
votes

Copypasta at OP's request:

Is "display: block" the exact inline style on the element?