【发布时间】:2012-01-07 10:00:25
【问题描述】:
我想知道 watirgrid / gridinit 是否可以与 Sikuli 结合使用。 http://www.sikuli.org
按照
中的示例,我已经成功地将 Sikuli 与 watir-webdriver 和 cucumber 集成这一切都由 Jruby 完成。
对我来说下一步是看看我是否可以使用 watirgrid 发送 sikuli 命令,但到目前为止我还没有成功。
我按照http://altentee.com/blogs/2010/watirgrid-support-for-watir-webdriver/中的例子进行了
我输入的内容:
irb
require 'watirgrid'
require 'watir-webdriver'
require 'java'
java_import "org.sikuli.script.SikuliScript"
java_import "org.sikuli.script.Region"
java_import "org.sikuli.script.Screen"
# setup a controller on port 12351 for your new grid
controller = Controller.new(
:ring_server_port => 12351,
:loglevel => Logger::ERROR)
controller.start
# add a provider to your grid
# :browser_type => 'webdriver' if using webdriver or
# :browser_type => 'ie' if using watir...
provider = Provider.new(
:ring_server_port => 12351,
:loglevel => Logger::ERROR, :browser_type => 'webdriver')
provider.start
# connect to the grid and take all providers from it (this time only one)
grid = Watir::Grid.new(:ring_server_port => 12351, :ring_server_host => '192.168.0.107')
screen=Screen.new
grid.start(:take_all => true)
+++++++++++++++ 到目前为止一切都很好。 ++++++++++++++++
+++++++++++++这就是轮子脱落的地方++++++++++++++
+++++++++++++++ 如何获取 watirgrid 可用的 screen 方法? ++++++++++++++++
irb(main):029:0* grid.screen.click("StartUpAdobe\/f.png",0)
NoMethodError: undefined method `screen' for #<Watir::Grid:0x1a0283e>
from (irb):29:in `evaluate'
from org/jruby/RubyKernel.java:1088:in `eval'
from C:/jruby-1.6.2/lib/ruby/1.8/irb.rb:158:in `eval_input'
from C:/jruby-1.6.2/lib/ruby/1.8/irb.rb:271:in `signal_status'
from C:/jruby-1.6.2/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1419:in `loop'
from org/jruby/RubyKernel.java:1191:in `catch'
from C:/jruby-1.6.2/lib/ruby/1.8/irb.rb:154:in `eval_input'
from C:/jruby-1.6.2/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1191:in `catch'
from C:/jruby-1.6.2/lib/ruby/1.8/irb.rb:70:in `start'
from C:\jruby-1.6.2\bin\irb:13:in `(root)'
我们有兴趣使用 watigrid 和 sikuli 来测试基于 vnc 的应用程序的性能。
【问题讨论】:
-
为了清楚起见,我打算编辑此内容,但我现在意识到我无法真正理解您在帖子细节中想说的内容。我可以建议您重新格式化以更清晰地显示您经历的过程吗?它需要很容易遵循你的思路。这将防止投反对票,并让您获得更多潜在回答者的关注。
标签: jruby watir watir-webdriver sikuli