← Back to team overview

sikuli-driver team mailing list archive

[Question #277162]: Sikulix cannot find images when using ruby

 

New question #277162 on Sikuli:
https://answers.launchpad.net/sikuli/+question/277162

Hi,

I've been trying to setup my own project to run scripts using ruby. Here's what I've done for the setup:
- Installed JRE
- Installed JRuby 1.7.23
- Set environment variable SIKULIXAPI_JAR
- Installed sikulix gem (jgem install sikulix) - 1.1.0.3

Then, I created a main_runner.rb file. In the same directory I added an images folder where I put all my images. My ruby script has the following:

<code>
require 'sikulix'
include Sikulix

base_path = ImagePath.getBundlePath()
ImagePath.add(base_path + "/images")

click("test.png")
</code>

The problem is that no matter what image I use and whichever part of the screen, I keep getting the following error:
StandardError: org.sikuli.script.FindFailed: can not find test.png in S(0)[0,0 1280x800]
   click at /Users/md/bin/jruby-1.7.23/lib/ruby/gems/shared/gems/sikulix-1.1.0.3/lib/sikulix/sikulix.rb:74
    call at org/jruby/RubyMethod.java:120
   click at /Users/md/bin/jruby-1.7.23/lib/ruby/gems/shared/gems/sikulix-1.1.0.3/lib/sikulix/sikulix.rb:178
  (root) at main_runner.rb:12

I've tried multiple things such as setting absolute path to a .png file. Trying different images. Increasing the timeout for find method. Nothing seems to work.

My environment:
Mac OS X 10.11.1

Any help would be greatly appreciated.
Thanks!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.