1

I want to compare one small part with full screenshot.

Screen screen=new Screen();
    Pattern pa1=new Pattern("/Users/37397/Desktop/Screen Shot 2018-03-27 at 6.02.42 PM.png");

    String img=screen.capture().save("/Users/1234/Desktop/Automation/Test_Sikuli/", "image");

    Finder f1=new Finder(screen.capture().getImage());
    f1.find(pa1);
    if(f1.hasNext()){

        Match m=f1.next();
        System.out.println("Match found with "+(m.getScore())+"100"+"%");
        f1.destroy();

    }
    else{

        System.out.println("No Match Found");
    }

In the above code 'pa1' contains a small logo and I want to check if this exact logo is present in the screen shot taken by Sikuli.

It's showing 'Match found with 0.9721086025238037100%' in console. How to make it 99%?

1 Answer 1

1

Try to get the screenshot from Selenium so its identical as much as possible.

Also change your code to multiply by 100 not to add it if you want proper percentage ;)

E.g.: System.out.println("Match found with "+(m.getScore() * 100) +"%");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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