GithubHelp home page GithubHelp logo

isabella232 / php-sikuli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from squizlabs/php-sikuli

0.0 0.0 0.0 75.84 MB

PHP wrappers for Sikuli

License: BSD 3-Clause "New" or "Revised" License

PHP 93.85% JavaScript 6.15%

php-sikuli's Introduction

About

PHPSikuli is a PHP5 wrapper for Sikuli.

Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components.

Installation

Sikuli is a Java application, that works on Windows XP+, Mac 10.6+ and most Linux/Unix systems. It requires Java JRE 6 or JRE 7 to be installed.

Clone PHPSikuli which includes Sikuli jar file:

git clone [email protected]:squizlabs/php-sikuli.git

Include either PHPSikuli.php or PHPSikuliBrowser.php in your project.

Documentation

Sikuli documentation can be found here. Most wrapper methods have same or very similar names however their usage slightly differ. E.g:

// Python
topLeft = Location(reg.x, reg.y) # equivalent to
topLeft = reg.getTopLeft()

theWidth = reg.w # equivalent to
theWidth = reg.getW()

reg.h = theWidth # equivalent to
reg.setH(theWidth)

// PHP
$topLeft = $sikuli->createLocation($sikuli->getX($reg), $sikuli->getY($reg));
$topLeft = $sikuli->getTopLeft($reg);

$theWidth = $sikuli->getW($reg);

$sikuli->setH($reg);

Code Example

require_once 'PHPSikuli/PHPSikuliBrowser.php';

// Use Firefox.
$sikuli = new PHPSikuliBrowser('firefox');

// Go to Google.
$sikuli->goToURL('http://www.google.com');

// Search for 'Squiz Labs'
$sikuli->type('Squiz Labs');
$sikuli->keyDown('Key.ENTER');

sleep(1);

// Find the Squiz Labs Home page link on the search results page.
$link = $sikuli->find('Home');

// Highlight the found text (region) for 2 seconds.
$sikuli->highlight($link, 2);

// Click the link.
$sikuli->click($link);

php-sikuli's People

Contributors

sertand avatar

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.