Am new to Sikuli and trying to Automate Citirx Application. Need Help
Am trying to select a user role in a screen, The screen has multiple roles and hence i need to scroll down the screen and search for a particular Role and click the Role.
I have Captured image of a Particular Role that i need to select and used below Code. In the second Image i have highlighted the Role i need to select in Red
Below is the Code an Trying:
Creating a Method:
public static boolean clipExist(Screen screen, String clip )
{
Match m = screen.exists(clip);
if(m != null)
{
return true;
}
else
{
return false;
}
}
Using the Method:
while(! clipExist(screen, "C:\\Users\\Satish_D1\\workspace\\Sikuli Demo\\Images\\DownArrow.PNG"))
{
screen.wheel(1 , 3);
if(clipExist(screen, "C:\\Users\\Satish_D1\\workspace\\Sikuli Demo\\Images\\Roles\\UK\\ENTP\\GEDIS_SALES_SUPPORT_ORL_CPF2.0_UK_ENTP.PNG"))
{
screen.doubleClick("C:\\Users\\Satish_D1\\workspace\\Sikuli Demo\\Images\\Roles\\UK\\ENTP\\GEDIS_SALES_SUPPORT_ORL_CPF2.0_UK_ENTP.PNG",0);
break;
}
}
The image recognision uses per default a similarity of 0.7 (see description of Patterns in SikuliX Documentation). That means SikuliX looks for 'pretty similar' images. You can specify the similarity for the pattern recognision thanks to the method similar
, or in your case use the method exact
.
In your method clipExist
, you should replace the name of the image:
Match m = screen.exists(clip);
by:
Match m = screen.exists(Pattern(clip).exact())