1. 基本常規操作
Screen s = new Screen();
s.click("圖片地址");//單擊圖片
s.doubleClick("圖片地址");//雙擊圖片
s.exists("圖片地址");//判斷是否存在該圖片,如果不存在則返回null
s.wait("圖片地址");//等待圖片加載
s.waitVanish("圖片地址");//等待圖片消失
Pattern p = new Pattern("圖片地址");
p.click(p.targetOffset(-100,100));//點擊以圖片中心爲原點,向左偏移100像素,向上偏移100像素的位置
s.waitVanish(new Pattern(Resource.IMG_NORMAL_PROGRESS).similar(0.9F));//waitVanish除了加阻塞進程的最長時間,還可以提高匹配度
Match match = s.exists(ImgUtil.getUrl(Resource.IMG_NORMAL_BUTTON_CLOSE),1);//exists可以這樣優化,再傳入一個long型變量,表示這個方法阻塞進程的最長時間