How can i integrate sikuli IDE to my C# application.

Asked by Sunil

Hi,

How can i integrate sikuli IDE to my C# application. Or how can i plugin the sikuli IDE with in my C# application.
Such that i can use all sikuli IDE option on my UI such as capturing the image,typing the text and so on.

I want to avoid duplication effort of rewriting the code to simulate sikuli IDE option.

Could you please help me on this.

Thanks.
Sunil

Question information

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

Sikuli IDE currently is a top-level monolithic Java Swing application. There is no official API, you can use.

The capture feature is done with the respective method of the Java AWT Robot class.

All Sikuli features like search, click ... are realized based on Java with some low level C++ modules (interfaces to OpenCV, ...), which are integrated using JNI. These are all packed together in sikuli-script.jar.

You might get more valuable information, if you get more specific on your goals.

Revision history for this message
Sunil (sunil-sjb) said :
#2

Please find more details on my goals

We have developed a automated tool which is being used by the user.
Now we are planning to integrate a feature to automate UI based testing along with existing features. and Sikuli meets our requirment.

But the only problem is user need to create a script using Sikuli and execute through our application (using command line execution of Sikuli).

So we want to provide a user where he can create a sikuli script from our application itself and then execute it.

To achieve this either we need to have sikuli integrated to our application or we need to implement all function which sikuli IDE supports.

Please let me know if more information is required.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

Ok, then with the current implementation of Sikuli IDE and the fact that your app is based on C#, you either have to decide, to give the users access to the Sikuli IDE or you have to setup your own GUI.

I do not think, that it makes sense, to modify the sources of Sikuli IDE, to adapt it to your needs and make an interface, to access the Java features in C#.

Your decision depends on the level of "freedom" the users should have to make scripts:
-- 1. full featured Jython scripts
you should use the Sikuli IDE (might be with some minor mods, to give it a look and feel, that fits with your app)

-- 2. scripts with a restricted set of Jython and or Sikuli features
This is the area, were it makes sense, to think about either modifying Sikuli IDE massively or make your own GUI

-- 3. scripts with a given set of features, that are transposed internally into Sikuli scripts (a private DSL)
only possible with your own GUI. all needed Sikuli features are available in sikuli-script.jar, no need for sikuli-ide.jar.

BTW: May be you know that already:
To be independent from the Sikuli IDE stuff at runtime, you should use
java -jar path-to-sikuli-script.jar path-to-your-script.sikuli

depending on your scripts and usage of Sikuli features, some additional Java environment parameters might be needed.

With this, the only things you need, is sikuli-script.jar and the native libraries from the package.

Revision history for this message
Sunil (sunil-sjb) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
mcamanish2007 (mcamanish2007) said :
#5

Hi Sunil,

Are you able to integrate sikuli IDE in C# application. If 'YES' then how?

Revision history for this message
mcamanish2007 (mcamanish2007) said :
#6

Hi Sunil,

How you solved this problem. May you please help me out?

Thanks. Manish