← Back to team overview

sikuli-driver team mailing list archive

[Question #263563]: Selenium test using Sikuli can't click on image when run from Jenkins

 

New question #263563 on Sikuli:
https://answers.launchpad.net/sikuli/+question/263563

I'm writing Selenium Webdrivr tests and I'm using Sikuli to click on a Browse button.  I have an image of the button stored on the disk, and here is my code.

ScreenRegion screen = new DesktopScreenRegion();
Mouse mouse = new DesktopMouse();
Keyboard kb = new DesktopKeyboard();
String sikuliImagesPath = getSikuliImagesPath();

Target browseTarget = new ImageTarget(new File(sikuliImagesPath + "browse.jpg"));
ScreenRegion browseRegion = screen.wait(browseTarget, 5000);
mouse.click(browseRegion.getCenter());

The selenium tests project is a Maven project and here is the Sikuli dependency in my pom.xml file:

<dependency>
            <groupId>org.sikuli</groupId>
            <artifactId>sikuli-api</artifactId>
            <version>1.0.2</version>
</dependency>

When I'm running the test from my IDE, a Firefox browser is launched and it's clicking on the button just fine. But when I run it from Jenkins, it's launching the browser on the same machine where it was previously working, but I get a NullPointerException, the button isn't found.  It uses the exact same code, on the same machine and the same browser version and config.

Do you have any idea why it's not working, can I provide any additional information that might be helpful?

Thank you!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.