2

So, I'm trying to combine Sikuli with Selenium tests in C#.

Sikuli4Net is working, but SikuliSharp isn't doing anything except not finding the images. They are however the exact same ones I'm using for both wrappers.

What am I missing?

Sikuli4Net:

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));

SikuliSharp:

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);
}
1

The problem in SikuliSharp is the 'culture sensitivity' in string.Format(), which caused a float to be passed as 0,7 instead of 0.7.

For details: https://github.com/christianrondeau/SikuliSharp/issues/8

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.