← Back to team overview

sikuli-driver team mailing list archive

[Question #690626]: Trying to find a String in an Image(captured while testing) using a String variable

 

New question #690626 on Sikuli:
https://answers.launchpad.net/sikuli/+question/690626

// allocating String as number as in real data am getting this from Excel 
String num = "123456";
//Am capturing the image and storing it in local folder
String result=Screen.capture(App.focusedWindow()).save("c:/Path", "image");
            
//Tried option 1 - Did not work as it is throwing Tessaract Exception error
               Finder f3 = new Finder(result);
               f3.findText(num);
               if (f3.hasNext())
{
execute code
}
//Tried option 2     - error - cannot compare java.lang.String to org.sikuli.Match
                if(result == num)
                {
                    System.out.println("The test case passed for");
                  
                } 
else
                    {
                    System.out.println("The test case failed" );
                  }

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.