Can't not start Screen() class

Asked by Louis Ragnarsson on 2018-05-18

I just start to try Sikuli. I am using Web Driver + IntelliJ + Maven module and Java, on Ubuntu 16.04.4. I use Maven Dependency to setup Sikuli, like this:

<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
        <dependency>
            <groupId>com.sikulix</groupId>
            <artifactId>sikulixapi</artifactId>
            <version>1.1.2</version>
        </dependency>

Whenever I start to run the test, I can't get pass Screen(), it always stops there, with this error:

[error] RunTimeAPI: loadLib: libVisionProxy.so not usable:
java.lang.UnsatisfiedLinkError: /home/ragnar/.Sikulix/SikulixLibs_201803141657/libVisionProxy.so: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
[error] RunTimeAPI: loadLib: libVisionProxy.so not usable:
java.lang.UnsatisfiedLinkError: /home/ragnar/.Sikulix/SikulixLibs_201803141657/libVisionProxy.so: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
[info] runcmd: ldconfig -p
[error] LinuxSupport: checking: OpenCV not in loader cache (see doc-note on OpenCV)
[error] LinuxSupport: checking: Tesseract not in loader cache (see doc-note on Tesseract)
[error] RunTimeAPI: Problematic lib: /home/ragnar/.Sikulix/SikulixLibs_201803141657/libVisionProxy.so (...TEMP...)
[error] RunTimeAPI: libVisionProxy.so loaded, but it might be a problem with needed dependent libraries
ERROR: ...TEMP...: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
[error] RunTimeAPI: *** terminating: problem with native library: libVisionProxy.so
Disconnected from the target VM, address: '127.0.0.1:40929', transport: 'socket'

This is my simple test to get to know Sikuli:

public class PlayAroundTest {
    @Test
    public void experimentTest() throws FindFailed, MalformedURLException {
        InternetExplorerOptions options = new InternetExplorerOptions();
        options.setCapability("ignoreZoomSetting", true);
        options.setCapability("nativeEvents", false);
        WebDriver driver = new RemoteWebDriver(new URL(remoteURL), options);
        Screen screen = new Screen(); // => Test is always terminated here with above error
        driver.manage().window().maximize();
        driver.get("http://www.seleniumhq.org/download/");
        driver.findElement(By.id("mainContent")).findElements(By.tagName("p")).get(6).
                findElements(By.tagName("a")).get(0).sendKeys(Keys.ENTER);
        screen.rightClick("D:\\SaveAsIE1.png");
        screen.keyDown(Key.DOWN);
        screen.click("D:\\SaveAsIE2.png");
        screen.type("a", Key.CTRL);
        screen.type(Key.BACKSPACE);
        screen.type("IEdriver");
        screen.click("D:\\SaveFile.png");
        System.out.println("File downloaded");
    }
}

Please can someone advise me how to fix this issue. Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-05-22
Last query:
2018-05-22
Last reply:
2018-05-18
Best RaiMan (raimund-hocke) said : #1

On Linux in any case you have to take care for the prerequisites according to:
http://sikulix-2014.readthedocs.io/en/latest/basicinfo.html#sikulix-on-linux

Louis Ragnarsson (ragnarsson) said : #2

Thanks RaiMan, that solved my question.