如何使用内联样式声明找到元素?
这是我的尝试:
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')
结果:
Watir :: Exception :: UnknownObjectException(无法找到元素,使用{:style =>“display:block”,:tag_name =>“div”}): app / controllers / streams_controller.rb:61:在`saveranks'
答案 0 :(得分:2)
Copypasta:
元素上的{em>完全内联样式是"display: block"
吗?