Giter Site home page Giter Site logo

rukuli's Introduction

Note

Now Sikuli supports ruby in IDE More info

Rukuli

Bitdeli Badge Code Climate

This project is a fork of sikuli_ruby!

SikuliX allows you to interact with your application's user interface using image based search to automate user actions.

Requirements

  • SikuliX 1.0.1 (Install sikuli-java.jar (option 4) via sikuli-setup.jar)
  • JRuby or rvm install jruby

Compatibility

Make sure to set SIKULIX_HOME to the Sikuli installation directory.

Windows

 setx SIKULIX_HOME C:/path/to/folder-containing-sikuli-java.jar

Linux / OSX

 export SIKULIX_HOME="~/path/to/folder-containing-sikuli-java.jar"

Installation

  gem install rukuli

Usage

  require 'java'
  require 'rukuli'

  Rukuli::Config.run do |config|
    config.image_path = "#{Dir.pwd}/images/"
    config.logging = false
  end

  screen = Rukuli::Screen.new
  screen.click(10, 10) # should open your apple menu

  app = Rukuli::App.new("iPhone Simulator")
  app.window.click('ui_element.png') if app.window.find('ui_element.png')

Running the test suite

  1. You need to open test_area.jpg in Preview from spec/support/images/ directory before running tests.
  2. You also need to open the TextEdit app

Examples

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

rukuli's People

Contributors

aimeerivers avatar anthonygreen avatar bitdeli-chef avatar chaslemley avatar dineshraj avatar etehtsea avatar ndrluis avatar ndrluistest avatar rpierreye avatar suhrawardi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rukuli's Issues

Wait image disappeared function

Hi, this is not an issue but just wanna ask is that function available?
I mean like wait a image disappeared then do next

Documentation wrong?

I tried to install on Ubuntu based off documentation and noticed that the ENV variable sikuli was looking for was SIKULI_HOME not SIKULIX_HOME. Also, I set the value to the folder of the jar file, but I think the value should specify that we are pointing to the jar file, not the folder.

This is concerning this line in the doc:
export SIKULIX_HOME="~/path/to/folder-containing-sikuli-java.jar"

sikuli-java.jar should be used here

Hi, this is RaiMan from SikuliX.

for all SikuliX usages with Java or any Java aware scripting language or system, it is recommended to use sikuli-java.jar (with version 1.1.0+ it will be sikulixapi.jar).

sikuli-script.jar will no longer be available (-IDE and -script will be together in sikulix.jar) already now sikulix-ide.jar can be used the same way as sikuli-script.jar, so the last one is obsolete.

Please adjust your docs accordingly.

BTW: for the version 1.2 the integration of JRuby in the same way as Jython is on the list.

new homepage for SikuliX: http://sikulix.com

all the best RaiMan

Could the similarity score be made a config option?

Hello! I'm having a bit of trouble with matching based on similarity. I'm fine with sending it to the "find" methods, but the problem is with the "click" methods that also need to match an image based on similarity.

I like to keep the similarity at about 0.7 most of the time, and temporarily bump it up to 0.9 or higher when i actually care about something being more of a precise match (distinguishing between two similar icons, for example) and then back down to 0.7 afterwards.

Sikulirb had a nice way of setting the similarity score which would then get applied to all finds and clicks. I wonder if we could achieve something like that for Rukuli. What do you think?

Sikuli 1.1

Dear colleagues,

I`m pleased to inform you that Sikuli 1.1 ( https://github.com/RaiMan/SikuliX-2014 ) supports now Ruby in IDE. It is used a new Ruby mediator - https://github.com/RaiMan/SikuliX-2014/tree/master/JRubyGem
Main features:

  • Widely used metaprogramming in Ruby over Java classes. Now there is no need to check Java API for every version of Sikuli. All methods of basic Java classes from Sikuli are accessible in Ruby. And all created objects are really Sikuli Java objects.
  • Most examples from http://doc.sikuli.org/ now appropriate to the Ruby version.
  • It is possible to use “undotted” methods like in Python version. E.g. click(), exists(), etc in global context.
  • Registration of hot-keys realized in Ruby style:
addHotkey( Key::F1, KeyModifier::ALT + KeyModifier::CTRL ) do
  popup 'hallo', 'Title'
end
  • Registration of events realized in Ruby style:
onAppear("123.png") { |e| popup 'hi', 'title' }

I invite you to collaborate in the field of GUI testing with Ruby and Sikuli.

Best regards,
Roman Samarev

Refactor tests

Make test with lightweight images and think in better way to make tests.

Problem with Rukuli::App#window ?

Hi,

I'm trying to use Rukuli on Windows and I'm getting the following error when I call Rukuli::App#window

$ jruby main.rb

C:/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/rukuli-1.0.3/lib/rukuli/region.rb:30: warning: ambiguous Java methods found, using org.sikuli.script.Region(java.awt.Rectangle)
org/sikuli/script/Region.java:254:in `<init>': java.lang.NullPointerException
        from C:/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/rukuli-1.0.3/lib/rukuli/region.rb:30:in `initialize'
        from C:/jruby-9.0.0.0.pre1/lib/ruby/gems/shared/gems/rukuli-1.0.3/lib/rukuli/app.rb:30:in `window'
        from main.rb:10:in `__script__'
        from main.rb:10:in `__script__'

Here's whats in main.rb:

# main.rb
CURRENT_DIR = File.expand_path(File.dirname(__FILE__))
ENV['SIKULIX_HOME'] = "#{CURRENT_DIR}/sikuli-java.jar"

require 'java'
require 'rukuli'

app = Rukuli::App.new 'Notepad'
app.focus

app.window.click 10, 10

In this example, everything seems to work (I see notepad open) except for the last line. Am I doing something wrong? Or could it be that Rukuli::Region#initialize and/or Rukuli::App#window should be different. I'm not familiar with how Sikuli works.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.