无法单击Celerity + Jruby中的某个按钮

时间:2011-11-17 04:07:38

标签: jruby celerity

哦屏幕抓取大师。我正在使用jruby和Celerity(两个最新版本),我无法弄清楚如何点击这个按钮。这是HTML代码:

<div class="chart-toolbar noprint" style="float: left;">
<ul>
<li>
</li>
<li>
<span class="btn-export icon-24 download-24" title="Export"></span>

我已经尝试了一切,我无法点击它。这是我目前的代码:

browser.button(:class, "btn-export icon-24 download-24").click

这是错误:

  

Celerity :: Exception :: UnknownObjectException:无法找到Button,使用:class和“btn-export icon-24 download-24”                 assert_exists at /opt/jruby/lib/ruby/gems/1.8/gems/celerity-0.9.1/lib/celerity/element.rb:179     assert_exists_and_enabled at /opt/jruby/lib/ruby/gems/1.8/gems/celerity-0.9.1/lib/celerity/clickable_element.rb:69                         单击/opt/jruby/lib/ruby/gems/1.8/gems/celerity-0.9.1/lib/celerity/clickable_element.rb:9                        (root)at ./test.rb:17

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

而不是

browser.button(:class, "btn-export icon-24 download-24").click

browser.span(:class, "btn-export icon-24 download-24").click

希望这会有所帮助!!