자바 웹 드라이버와 sikuli를 사용하여 flex를 사용하여 하나의 웹 사이트 응용 프로그램을 자동화하려고하면 "java.lang.IllegalThreadStateException : Can not call 다음 코드 또한Sikuli : java.lang.IllegalThreadStateException : 이벤트 디스패처 스레드에서 메서드를 호출 할 수 없습니다.
public static void clickImage(String folder, String file) throws FindFailed {
Screen screen;
File loc = new File("images/" + folder + "/" + file + ".png");
Pattern image = new Pattern(loc.getAbsolutePath());
screen = new Screen();
if (isImagePresent(image, 20)) {
try{
waitUntilLoadCompletes(folder);
screen.click(image,0);//This method is throwing error
}catch(Exception e){System.out.println("click has some prblm"+e);}
} else {
new Exception(file+"not found");
}
를 사용하여 버튼을 클릭 한 후 나는 다음과 같은 오류뿐만 아니라 [오류] mouseDown 무엇입니까 "이벤트 디스패처 스레드에서 방법 : 버튼을 계속 누르면 -이 클릭하는 것처럼 모든 를 사용하여 본다 이미지는 버튼을 놓지 않고 마우스 버튼을 누르지 만 놓지는 않습니다. 그것은 오류가 발생합니다 버튼을 해제하기 전에 나는 위의 코드에서 사용되는 I는 다음 FN 절전 모드를 사용하고
생각
public static boolean isImagePresent(Pattern img, int time) {
Screen screen=new Screen();
int i = 0;
while (i < time) {
try {
System.out.println(screen.exists(img).toString());
return true;
} catch (Exception e) {
System.out.println("waiting for image--- "+i+" seconds");
}
i++;
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Logger.getLogger(Library.class.getName()).log(Level.SEVERE, null, ex);
}
}
return false;
}