christianrondeau / sikulisharp Goto Github PK
View Code? Open in Web Editor NEWA fast and simple Sikuli wrapper for .Net
License: MIT License
A fast and simple Sikuli wrapper for .Net
License: MIT License
I can't send special keys by Type
function such as ENTER, TAB, ESC, SPACE
.
Hi @christianrondeau,
I have been using the SikuliSharp package and it is quite powerful and fast. However, am facing issues while trying to extract text from the image.
I am using this command: var result = runtime.Run(@"print ""RE:""+ Region(553,548,91,24).text()", "RE:", 10).
Its extracting but the text is not accurate. I tried the same text extraction using the Sikuli IDE (version 2.0.5) and it is perfectly extracting it. As the latest Sikuli is coming with better OCR capabilities, Need your suggestion/help to invoke the latest sikuli api available here (https://raiman.github.io/SikuliX1/downloads.html) Appreciate your help. Thanks
Hi there,
I need to use the Sikuli Region Class, are there any plans to add this class to the library?
Thanks!
Lily
So... I was hoping to be able to use SikuliSharp but it fails to find the Google Logo in my test below.
Could be my mistake, but the exact same image and code works for the Sikuli4Net wrapper.
The SikuliSharp code timeouts after 7 seconds (as set in the method call) so everything appears to "work" properly, expect that the image isn't recognized while it should be (as proven by the other wrapper).
SikuliSharp code:
using (var session = Sikuli.CreateSession())
{
var gLogo = Patterns.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\google-logo.PNG");
var gSearch = Patterns.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\google-search.JPG");
var xResult = Patterns.FromFile(AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\abc-detail.JPG");
session.Exists(gLogo, 7);
session.Wait(gSearch, 7);
session.Type("abc");
session.Exists(xResult, 5);
}
Sikuli4Net code:
Screen gHome = new Screen();
Pattern gLogo = new Pattern(AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\google-logo.PNG");
Pattern gSearch = new Pattern(AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\google-search.JPG");
Pattern xResult = new Pattern(AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\abc-detail.JPG");
Assert.IsTrue(gHome.Exists(gLogo, 7));
gHome.Type(gSearch, "abc");
Assert.IsTrue(gHome.Exists(xResult, 7));
Hay, I just use your SikuliSharp, have some question.
Why I using
using (var session = Sikuli.CreateSession())
{
var pattern = Patterns.FromFile(@"C:\Patterns\MyPattern.png");
session.Exists(pattern);
}
And Sikuli.CreateSession() will throw time out exception?
In the new version the library and scripts names have changed, also the environment variable's name. Other stuff may have changed as well
Is it possible to allow spaces in project path to work by changing this portion of the code ...
SikuliSharp/SikuliSharp/SikuliVersion.cs
Lines 46 to 50 in 3b64684
... to this?
public ISikuliVersion WithProject(string projectPath, string args)
{
Arguments = string.Format("-jar \"{0}\" -r \"{1}\" {2}", _jar, projectPath, args);
return this;
}
Hi Christian,
I've been using your Sikuli wrapper for couple of months now and it's working out pretty well for us.
However, there's this issue that creates a lot of problem here..
We've noticed that randomly Session.Type command will miss entering characters..
Example: Session.Type("abcdef") would type in "abcf" randomly and would work correctly other times.
I've tried to add a sleep also in between the click and type commands to see if it's related to timing, but it did not help.
Are you aware of this issue ? I am using SikuliSharp 1.0.3 release. Thanks much.
Could any one please help me with this issue.
Hi there, thanks for this wrapper.
Is possible to include other commands, like "rigth-click", "double-click" and "drap-drop"?
Thank you!
Hi Chris,
Could you help to create functions to support setting the speed value like mouse move, text typing etc....
Thanks and Best Regards,
Tai Nguyen
Hi,
I have a quick look in the code and see that it maybe something wrong for this
[code]
protected bool RunCommand(string command, IPattern pattern, float timeoutInSeconds)
{
pattern.Validate();
var script = string.Format(
"print \"SIKULI#: YES\" if {0}({1}{2}) else \"SIKULI#: NO\"",
command,
pattern.ToSikuliScript(),
AddTimeout(timeoutInSeconds)
);
...
}
[code]
This will ad a key modifier code into click function in stead of a timeout for click action.
Please help me check.
Hi there,
Thank you for creating this wrapper.
I have a sikuli script that automates installation of firefox. It accepts command line argument - filename. In my c# code, I tried to call it with Sikuli.RunProject(args[0], args[1]) where
args[0] = path of firefox.sikuli
args[1] = "--args firefox-installer-here"
Upon running, i noticed that app focus remains the "cmd". I tried to edit my script to hardcode the filename and just call the Sikuli.RunProject(args[0]) and it runs successfully. Any recommendation?
Hi, is this wrapper support target offset? If someone want to change default target offset?
The library is looking for .exe java executables running on Mac and Mono
Hello,
I would like to get the bounds (coordinates) of a control after an exists command. As this is not available directly, I used the getLastMatch in the IDE and got a successful result. However when fire the command using the SikuliRuntime, I cannot get it to work. can you help me out. Here is the function I am trying to use:
` public void RunCommand()
{
using (var runtime = Sikuli.CreateRuntime(150))
{
runtime.Start();
var img = Patterns.FromFile(@"F:\Shashank\tools.png", .7f);
var result = runtime.Run(
@"print ""RESULT:"" "+"getLastMatch() "+ "if exists(Patterns.FromFile("+"F:\\Shashank\\tools.png"+", .7f)" + ") else "+ "\"RESULT: FAIL\"" ,
"RESULT:",
0d
);
}
}`
The pattern img, will have a different image everytime.
Console.WriteLine("Ready!");
using (var session = Sikuli.CreateSession())
{
Console.WriteLine("Entered!");
// Do stuff
}
To go from "Ready!" to "Entered!" it takes about 8 seconds to just create the session, Can I optimize that?
Hi I have enjoyed the SikuliSharp wrapper for a while for Siluli 1.0. We need to upgrade this to Sikuli 2.0.2 and was wandering if someone can help us with the updated packages
I want to click at specific Point on screen. But click at location is not available. Is there way to achieve it using SikuliSharp?
Hi christianrondeau,
I have some doubt that when I run the code as below if the pattern cannot be found, my test application seem hangs in this state and cannot process to next action.
Session.Click(pattern);
I expected that it would return "SIKULI# : NO" as the script you specified for run in the RunCommand functions but it would not, after do some checks I found that some sikuli actions like "click","wait","exists"... would throw an exception FindFailed if the pattern cannot be found on the screen instead of return anything, that maybe the cause why the RunCommand function would not return.
Can you help to check this again.
Regards,
Hi, I always get the timeout exception, when try to run a SikuliSession, below is the stack trace.
StackTrace:
AsyncTwoWayStreamHaldler.ReadUntil(Double timeoutInSeconds, String[] expectedStrings)
SikuliRuntime.Start()
Sikuli.CreateSession()
Any idea how to solve this issue.
Best Regards.
Functions such as Pattern.exact()
, Pattern.anySize()
or Pattern.anyColor()
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.