Chapter 1 Introduction to Sikuli

Embed Size (px)

Citation preview

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    1/13

    LEVELPRACTITIONER

    Sikuli

    Chapter 1 -Introduction to Sikuli

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    2/13

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    3/13

    Introduction to Sikuli: Contents

    3

    Introduction:

    Sikuli Overview

    Sikuli Architecture

    Supported Platforms

    Sikuli Integration

    Why Sikuli?

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    4/13

    Introduction to Sikuli : Objectives

    4

    Objectives:

    After completing this chapter you will be able to understand:

    The Overview of Sikuli

    Sikuli Architecture

    Platforms supported

    Sikuli integration with the other IDEs

    Why to choose Sikuli

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    5/13

    5

    Sikuli Overview

    What is Sikuli

    Sikuli is an open-source research project originally started at the User Interface

    Design Group at MIT(Massachusetts Institute of Technology - Cambridge).

    Scripting is done using Pythonand also with java based languages.

    Its further development and maintenance is carried out by the Sikuli Lab at the

    University of Colorado Boulder in coordination with the open-source community.

    Sikuli is currently maintained and released under the MIT License (Open Source).

    Sikuli Script automates anything you see on the screen.

    It uses image recognition to identify and control GUI components.

    It is useful when there is no easy access to a GUI's internal or source code.

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    6/13

    6

    Sikuli Architecture - The Workflow

    Sikuli IDE

    Python Interpreter

    (Jython)

    Java Runtime

    Environment

    Sikuli scripts

    (.sikuli)

    Edit

    ExecuteImages

    (.png)

    Python

    source file

    (.py)

    Sikuli Architecture

    Jython API

    Import(auto)

    Sikuli script

    Import

    Use

    Java.awt Robot C++ Engine Open CV

    JNIJava API

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    7/13

    How Sikuli Works

    Sikuli Script that automates GUI interaction using image patterns to direct

    keyboard/mouse events uses Jython and Java library.

    The core of Sikuli Script is a Java library that consists of two parts:

    java.awt.Robot: Delivers keyboard and mouse events to appropriate locations.

    C++ engine based onOpenCV :Searches given image patterns on the screen.

    The JNI(Java Native Interface) connects the Java with the C++ engine and needs to

    be compiled for each platform.

    A thin Jython layer is provided on top of the Java library, for end-users as a set of

    simple and clear commands. Therefore, it should be easy to add more thin layers

    for other languages running on JVM. e.g. JRuby, Scala, Javascript, etc.7

    Sikuli Architecture

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    8/13

    A Sikuli script (.sikuli) is a directory that consists of a Python source file (.py), and all the

    image files (.png) used by the source file(Refer the Architecture diagram)

    All images used in a Sikuli script are simply a path to the .png file in the .sikuli bundle.

    The text editor can be used to edit the Python source file.

    In order to share the scripts on web easily a new HTML file will get generated while

    saving the script using sikuli.

    A Sikuli executable script (.skl) is simply a zipped file of all files in the .sikuli directory.

    Sikuli IDE runs without showing the IDE window if a .skl is seen.

    If a .sikuli is seen, Sikuli IDE opens it in a source code editor.

    8

    Sikuli Architecture (contd)

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    9/13

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    10/13

    With Other IDEs (Mac and Windows)

    Sikuli can be successfully integrated with other IDEs like NetBeans (NetBeans 6.9)

    and Eclipse (Eclipse Helios 3.6).

    Integration is needed because

    It has more features than sikuli IDE.

    It can develop packages combining sikuli and java.

    It has a debugger for the package/scripts.

    It can have a versioning system.

    The below two plugins are required for Integration

    Python plugin that comes bundled with Jython 2.5.1.

    Python plugin (PyDev) and Jython for Eclipse.

    Sikuli Integration

    10

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    11/13

    Why Sikuli

    Anything you see on the screen can be automated using Sikuli.

    It is a free ware and easy to install.

    Suitable for Multi OS, Multi Browser and Multi Lingual testing.

    Can be easily integrated with many IDEs using Java.

    Scripting with sikuli is more easier when comparing with other open source tools.

    Script less Automation techniques are feasible with Sikuli slides(will be covered on the

    forthcoming slides)

    Why Sikuli

    11

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    12/13

    What combination of scripting languages are used in Sikuli?

    a) Java + Ruby

    b) Python + Ruby

    c) Java + Python

    d) None of the Above

    Which of the following browsers are supported by Sikuli?

    a) Internet Explorer and Google Chrome

    b) Mozilla Firefox and Bing

    c) Opera and Netscape

    d) All the above

    Sikuli can be integrated with Eclipse

    a) True

    b) False

    Test your Understanding

    12

  • 8/12/2019 Chapter 1 Introduction to Sikuli

    13/13

    Sikuli

    You have successfully completed -

    Introduction to Sikuli