skrypton-api

A browser automation library that uses SikuliX and doesn't grab grab your mouse

License

License

GroupId

GroupId

com.waicool20.skrypton
ArtifactId

ArtifactId

skrypton-api
Last Version

Last Version

1.0.0-alpha
Release Date

Release Date

Type

Type

jar
Description

Description

skrypton-api
A browser automation library that uses SikuliX and doesn't grab grab your mouse
Project URL

Project URL

https://github.com/waicool20/SKrypton
Source Code Management

Source Code Management

https://github.com/waicool20/SKrypton

Download skrypton-api

How to add to project

<!-- https://jarcasting.com/artifacts/com.waicool20.skrypton/skrypton-api/ -->
<dependency>
    <groupId>com.waicool20.skrypton</groupId>
    <artifactId>skrypton-api</artifactId>
    <version>1.0.0-alpha</version>
</dependency>
// https://jarcasting.com/artifacts/com.waicool20.skrypton/skrypton-api/
implementation 'com.waicool20.skrypton:skrypton-api:1.0.0-alpha'
// https://jarcasting.com/artifacts/com.waicool20.skrypton/skrypton-api/
implementation ("com.waicool20.skrypton:skrypton-api:1.0.0-alpha")
'com.waicool20.skrypton:skrypton-api:jar:1.0.0-alpha'
<dependency org="com.waicool20.skrypton" name="skrypton-api" rev="1.0.0-alpha">
  <artifact name="skrypton-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.waicool20.skrypton', module='skrypton-api', version='1.0.0-alpha')
)
libraryDependencies += "com.waicool20.skrypton" % "skrypton-api" % "1.0.0-alpha"
[com.waicool20.skrypton/skrypton-api "1.0.0-alpha"]

Dependencies

compile (4)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jre8 jar 1.1.51
org.slf4j : slf4j-api jar 1.7.25
com.sikulix : sikulixapi jar 1.1.2-SNAPSHOT
com.sikulix : sikulixlibslux jar 1.1.2-SNAPSHOT

Project Modules

There are no modules declared in this project.

SKrypton Build Status Build status Download

A browser automation library that uses the SikuliX framework but doesn't grab the mouse.

This library uses QtWebEngine as its backbone for displaying webpages, therefore apart from SikuliX this project also has its own set of native components which need to be pre-installed. The library utilizes JNI to bridge between the native and JVM side.

The library works by providing its own sub-classes of Region, Match and Screen (Just prefixed with SKrypton) Each SKryptonScreen instance has its own virtual mouse, keyboard and clipboard. Therefore each can be controlled independently from each other and the desktop. To aid debugging, a virtual mouse indicator (Visibility can be toggled) has been added.

The name SKrypton comes from combining Script and Krypton, why Krypton? Because it's an element two Atomic Numbers away from Selenium another well-known browser automation tool named after an element. SKrypton can support control from Selenium if remote debug port is enabled.

Here's a small clip to see it in action

This is the file being showcased

Installation and Usage

I just want to run a SKrypton program!:

  • Requires Java JRE 8 installed
  • SKrypton Native components (Installable Jar under Downloads, just double click and follow instructions)

Developing with the API:

Official builds

SKrypton is available on the jcenter and maven central repository, replace VERSION with the version specified by the badge above or a version of your own choosing.

repositories {
    // For resolving SKrypton artifacts
    jcenter()       // or mavenCentral()
    // For resolving SikuliX artifacts
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
    compile group: 'com.waicool20.skrypton', name: 'skrypton-api', version: 'VERSION'
}

Snapshots

Snapshots for api jar are available here

To include the library API snapshot in your project you can add this snippet to your build.gradle file, replace VERSION with a specific snapshot (Take a look in the link above and get the latest one)

repositories {
    // For resolving SKrypton artifacts
    maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
    // For resolving SikuliX artifacts
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
    compile group: 'com.waicool20.skrypton', name: 'skrypton-api', version: 'VERSION'
}

Snapshots for the installers are also available in the group directory

Quick start (Kotlin API):

fun main(args: Array<String>) {
    /* Initialize the SKryptonApp instance with the args from the command line
       Since SKryptonApp is chromium based, we can enable DevTools on port 8888
       and access it through localhost:8888 */
    SKryptonApp.initialize(args, remoteDebugPort = 8888) {
        // Initialize a screen with the given URL
        screen("https://github.com/waicool20/SKrypton") {
            // Click coordinates X: 100 Y: 100
            // This is from the SikuliX API, refer to these docs for more info:
            // https://sikulix-2014.readthedocs.io/en/latest/region.html
            click(Location(100, 100))
        }
        // Initialize a screen with the given URL, width and height
        screen("https://github.com/waicool20/SKrypton", width = 800, height = 600) {
            // Type "Hello World!" into the screen.
            // This is from the SikuliX API, refer to these docs for more info:
            // https://sikulix-2014.readthedocs.io/en/latest/region.html        
            type("Hello World!") 
        }
        // Initialize a screen that doesn't show the virtual cursor
        screen("https://github.com/waicool20/SKrypton", showCursor = false) {
            // Move mouse to X: 100 Y: 100 but don't click
            // This is from the SikuliX API, refer to these docs for more info:
            // https://sikulix-2014.readthedocs.io/en/latest/region.html
            hover(Location(100, 100))
        }        
    }.exec(true) // Finally execute the SKryptonApp instance
}

Documentation

You are welcome to checkout the API documentation over here

Build instructions

Prerequisites:

Common:

  • Java JDK 8
  • CMake 3.9.x
  • Qt 5.9.1
    • QtWebEngine is a required component and must be installed
    • On Windows, MSVC version must be used (MinGW etc. versions are untested)

Linux:

  • GNU GCC7 (Available readily under this PPA ubuntu-toolchain-r-teston Ubuntu based distros)
  • GNU G++7 (Available readily under this PPA ubuntu-toolchain-r-teston Ubuntu based distros)
  • libGLESv2 (Typically incl. in libgles2-mesa package on Ubuntu based distros)
  • libEGL (Typically incl. in libegl1-mesa package on Ubuntu based distros)

Windows:


Actually building the project:

Linux:

# Build API Jar and native components release jar only
./gradlew build

# Build All Jars (incls. Test Jar and native components debug jar)
./gradlew buildAll

Windows:

# Build API Jar and native components release jar only
gradlew.bat build

# Build All Jars (incls. Test Jar and native components debug jar)
gradlew.bat buildAll

API Jar and Test Jar are generated under:

build/libs

Native component Jars are generated under:

native/build/libs

License

This project is licensed under the MIT license. See LICENSE.md for more details.

Versions

Version
1.0.0-alpha