-
Notifications
You must be signed in to change notification settings - Fork 22
Getting started
Alexey Nikolaenko edited this page Oct 15, 2015
·
3 revisions
Binaries and dependency information for Maven, Gradle and other build tools can be found at http://search.maven.org.
<dependency>
<groupId>io.sterodium</groupId>
<artifactId>sikuli-extension-client</artifactId>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>io.sterodium</groupId>
<artifactId>file-extension-client</artifactId>
<version>x.y.z</version>
</dependency>
Get session id from RemoteWebDriver
String sessionId = remoteWebDriver.getSessionId();
Create Sikuli client and upload images to selenium node:
SikuliExtensionClient client = new SikuliExtensionClient(host, port, sessionId);
client.uploadResourceBundle("my_images_folder");
Locate image on screen and click:
TargetFactory targetFactory = client.getTargetFactory();
ImageTarget imageTarget = targetFactory.createImageTarget("image.png");
DesktopScreenRegion desktop = client.getDesktop();
ScreenRegion screenRegion = desktop.find(imageTarget);
Mouse mouse = client.getMouse();
mouse.click(screenRegion.getCenter());
Refer to Sikuli docs for basic Sikuli API usage.
File upload to selenium node:
FileExtensionClient fileExtensionClient = new FileExtensionClient(host, port, sessionId);
String uploadPath = fileExtensionClient.upload(resourceBundlePath);
File download from selenium node:
FileExtensionClient fileExtensionClient = new FileExtensionClient(host, port, sessionId);
File fileFromNode = fileExtensionClient.download(pathToFile);