0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Sikulixの学習

Posted at

概要

Sikulixに触れまして、その備忘録を残します。。。
簡単なサンプルコードでの動作確認にとどめていますので
ご了承ください。

準備

1)Javaをインストール
2)Sikulix IDE(sikulixide-2.0.5.jar) をダウンロード
3)JRuby(jruby-complete-10.0.2.0.jar)をSikulixのExtensionsフォルダに配置
 C:\Users\ユーザー名\AppData\Roaming\Sikulix\Extensions
4)3でのフォルダでJRubyにgemをインストール

java -jar jruby-complete-10.0.2.0.jar -S gem install sikuli

5)Sikulix IDEとJRubyを同じディレクトリに置く。
JRubyは3でのものと同一のものを置く。

実行 メモ帳の起動

今回はメモ帳を起動して任意の文字列を入力できるようにしました。
ディレクトリ構成は次のようになっています。

C:\SikukiX
├─ sikulixide-2.0.5.jar
├─ jruby-complete-10.0.2.0.jar
└─ sample.rb

sample.rb
require 'java'
include Java

# SikuliXのライブラリを読み込む
require_relative 'sikulixide-2.0.5.jar'

java_import 'org.sikuli.script.Screen'

screen = Screen.new

# メモ帳を起動(Windows環境)
system("notepad")

# 少し待機
sleep(2)

# "Hello World" を入力
screen.type("Hello World")

実行コマンド

java -cp "jruby-complete-10.0.2.0.jar;sikulixide-2.0.5.jar" org.jruby.Main sample.rb
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?