Need to check how to use sikuli with Selenium in Docker

Asked by Milind Warade

Hello,

I am using Selenium and Sikuli in Windows and Ubantu in Java programing.
For example, I am giving other sample code.

package com.sikuli.demo;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;
import org.openqa.selenium.chrome.ChromeDriver;

public class SikuliDemo {

    public static void main(String[] args) throws FindFailed {

        System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
        String filepath = "D:\\Guru99Demo\\Files\\";
        String inputFilePath = "D:\\Guru99Demo\\Files\\";
        Screen s = new Screen();
        Pattern fileInputTextBox = new Pattern(filepath + "FileTextBox.PNG");
        Pattern openButton = new Pattern(filepath + "OpenButton.PNG");
        WebDriver driver;

        // Open Chrome browser
        driver = new ChromeDriver();
        driver.get("http://demo.guru99.com/test/image_upload/index.php");

        // Click on Browse button and handle windows pop up using Sikuli
        driver.findElement(By.xpath(".//*[@id='photoimg']")).click();
        s.wait(fileInputTextBox, 20);
        s.type(fileInputTextBox, inputFilePath + "Test.docx");
        s.click(openButton);

        // Close the browser
        driver.close();

    }

}

I need to execute code in Docker (installed Docker on Ubanu machine).
Using one docker file as of now.
docker pull selenium/standalone-chrome

If you can suggest how to integrated Sikuli in any docker image it will great. ( like selenium-chrome base image..need to integrate Sikuli with the same)

Basically, i have created few keyword driven framework which is using Selenium and Sikuli. But, if I need to execute in docker ...need to check how both selenium and sikuli work together.

Please do needful help. Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Milind Warade
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

I think, this is not the right place to ask such specific docker stuff.

Maybe stack-overflow or similar expert places are better.

I guess, the problem you are facing is the headless thing.
You have to implement some fake screen (like xvfb or similar).

Revision history for this message
Milind Warade (warademilind) said :
#2

Thanks RaiMan