Unable to work with SikuliSharp in C#

Asked by Chandan

I am trying to use Sikuli to automate a Windows application developed in WPF by our client. I have checked it directly using SikulixIDE.2.0.5.jar and its working perfectly. But all the data are hardcoded in that. Instead I need to make it dynamic and configurable using an application. So I am trying to build a C#.NET application to configure all these data.

For this I tried adding SikuliSharp from Nuget package manager and tried the below code. But while trying to create a Sikuli session, it fails.

using (var session = Sikuli.CreateSession())
            {

                var nextButton = Patterns.FromFile(@"C:\Automation\Sikuli.sikuli\1715933882452.png");
                session.Wait(nextButton, 5);
                session.Click(nextButton);
            }

System.NotSupportedException: 'Could not find a known Sikuli version in SIKULI_HOME: "C:\NewSikuliSetup"'

Looks like it is trying to identify whether Sikuli is installed in the PC. But it is not yet installed. Below is the Java version installed in my PC.

C:\SikuliFiles>java -version
openjdk version "1.8.0_412"
OpenJDK Runtime Environment (build 1.8.0_412-b08)
OpenJDK 64-Bit Server VM (build 25.412-b08, mixed mode)

After this check, I downloaded the sikulixsetup-1.1.3.jar and ran the command java -jar y"path to the jar file" for which I get the below error. Installation is not successful.

[debug (21/5/24 1:07:11 PM)] Debug: setLogFile: C:\NewSikuliSetup\SikuliX-1.1.3-SetupLog.txt
[debug (21/5/24 1:07:11 PM)] RunSetup: ... starting with no args given
[debug (21/5/24 1:07:11 PM)] RunSetup: Setup: 1.1.3 2018-07-11_08:19 in folder:
C:\NewSikuliSetup
[debug (21/5/24 1:07:11 PM)] RunSetup: RunningSystem: Windows 10.0
[debug (21/5/24 1:07:11 PM)] RunSetup: parent of jar/classes: C:\NewSikuliSetup
[debug (21/5/24 1:07:11 PM)] RunSetup: RunningJava: Java 8 (amd64) 1.8.0_412-b08
[debug (21/5/24 1:07:11 PM)] init user preferences
[debug (21/5/24 1:07:31 PM)] RunSetup:
popAsk: --------------------
The following file(s) will be downloaded to
C:\NewSikuliSetup
--- Native support libraries for Windows (sikulixlibs...)
--- Package 1 ---
null (IDE/Scripting)
null (Java API)
 - with Jython
--- Package 2 ---
null (done in package 1)
Only click NO, if you want to terminate setup now!
Click YES even if you want to use local copies in Downloads!
--------------------
[debug (21/5/24 1:07:40 PM)] FileManager: Downloading sikulixlibswin-1.1.1.jar with unknown size
[error (21/5/24 1:07:40 PM)] FileManager: problems while downloading
java.net.UnknownHostException: repo1.maven.org
[debug (21/5/24 1:07:43 PM)] FileManager: download to string from:
https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixsetupAPI/1.1.3-SNAPSHOT/maven-metadata.xml,
[error (21/5/24 1:07:43 PM)] FileManager: problems while downloading
oss.sonatype.org
[error (21/5/24 1:07:43 PM)] RunSetup: Maven download: could not get timestamp nor buildnumber for sikulixsetupAPI#forsetup from:
https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixsetupAPI/1.1.3-SNAPSHOT/maven-metadata.xml
with content:

[debug (21/5/24 1:07:43 PM)] FileManager: download to string from:
https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixsetupIDE/1.1.3-SNAPSHOT/maven-metadata.xml,
[error (21/5/24 1:07:43 PM)] FileManager: problems while downloading
oss.sonatype.org
[error (21/5/24 1:07:43 PM)] RunSetup: Maven download: could not get timestamp nor buildnumber for sikulixsetupIDE#forsetup from:
https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixsetupIDE/1.1.3-SNAPSHOT/maven-metadata.xml
with content:

[debug (21/5/24 1:07:43 PM)] RunSetup:
popAsk: --------------------
If you click YES, you will get Jython version 2.7.0 (recommended)
... but in rare cases there might be issues with UTF-8/Unicode
that usually appear on startup when UTF-8 characters
are present somewhere in the system environment
If you encounter such problems with Jython 2.7.0
run setup again and
click NO to get Jython a 2.5.4 version
--------------------
[debug (21/5/24 1:08:02 PM)] RunSetup:
popAsk: --------------------
You have for Jython 2.7
C:\NewSikuliSetup\jython-standalone-2.7.1.jar
Click YES, if you want to use this for setup processing
... or click NO, to ignore it and download a fresh copy
--------------------
[debug (21/5/24 1:08:04 PM)] RunSetup: Copied from Downloads: Jython
[debug (21/5/24 1:08:04 PM)] RunSetup: Download ended
[debug (21/5/24 1:08:04 PM)] RunSetup: Downloads for selected options:
sikulixlibswin-1.1.1.jar null null jython-standalone-2.7.1.jar
[debug (21/5/24 1:08:04 PM)] RunSetup:
popError: --------------------
Some of the downloads did not complete successfully.
Check the logfile for possible error causes.
If you think, setup's inline download is blocked somehow on
your system, you might download the appropriate raw packages manually
into the folder Downloads in the setup folder and run setup again.
files to download (information is in the setup log file too)
sikulixlibswin-1.1.1.jar
null
null
jython-standalone-2.7.1.jar
Be aware: The raw packages are not useable without being processed by setup!
For other reasons, you might simply try to run setup again.
--------------------
[error (21/5/24 1:08:07 PM)] RunSetup: download not completed successfully
[error (21/5/24 1:08:07 PM)] RunSetup: ... terminated abnormally :-(
[debug (21/5/24 1:08:07 PM)] RunSetup:
popError: --------------------
Something serious happened! Sikuli not useable!
Check the error log at C:\NewSikuliSetup\SikuliX-1.1.3-SetupLog.txt
--------------------
[debug (21/5/24 1:08:08 PM)] RunTimeSETUP: final cleanup
[debug (21/5/24 1:08:08 PM)] FileManager: deleteFileOrFolder:
C:\Users\hxe1cob\AppData\Local\Temp\Sikulix_996036288

I am not ale to successfully install Sikuli so that the sikuli service will be available for C#.Net code to execute.

Requesting your help in fixing it and installing the same in my PC.

Regards,
Chandan

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Eleanorreo (eleanorreo) said (last edit ):
#1

To fix the Sikuli installation issue, ensure a stable internet connection for downloading dependencies. Alternatively, manually download necessary packages and place them in the setup folder. Verify SIKULI_HOME path correctness. For dynamic data handling, consider using configuration files or databases to input data into your C#.NET application.

http://resourcepartner.net/

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.