나는 sikuli에 완전히 익숙하지 않아 나를위한 로켓 과학이 된 이미지 스크린 샷을 간단히 클릭하려고합니다.sikuli 스크립트가 이미지를 클릭하지 않는 이유는 무엇입니까?
FYI - Google 로고 캡쳐 화면을 내 컴퓨터에 저장했습니다. 그러나 실제 Google 로고 이미지 URL을 가져 오면 스크립트가 작동합니다.
이미지 캡쳐 화면을 사용하는 것이 올바른 방법입니까?
public class TestGenericButton {
public static void main(String[] args) throws MalformedURLException {
// Open the main page of Google Code in the default web browser
browse(new URL("http://code.google.com"));
// Create a screen region object that corresponds to the default monitor in full screen
ScreenRegion s = new DesktopScreenRegion();
// Specify an image as the target to find on the screen
//URL imageURL = new URL("http://code.google.com/images/code_logo.gif");
URL imageURL = new URL("img\\google.gif");
Target imageTarget = new ImageTarget(imageURL);
// Wait for the target to become visible on the screen for at most 5 seconds
// Once the target is visible, it returns a screen region object corresponding
// to the region occupied by this target
ScreenRegion r = s.wait(imageTarget,5000);
// Display "Hello World" next to the found target for 3 seconds
Canvas canvas = new DesktopCanvas();
canvas.addLabel(r, "Hello World").display(3);
// Click the center of the found target
Mouse mouse = new DesktopMouse();
mouse.rightClick(r.getCenter());
}
}
을 수행해야합니다 ? – Akbar