[英]How to set Sikuli path
我正在使用SikuliX來測試我的游戲。 這是我正在運行的代碼:
public void testApplication() throws FindFailed {
// pass if there are merely no warnings/exceptions
/* Example of using Jelly Tools (additional test dependencies required) with gui(true):
new ActionNoBlock("Help|About", null).performMenu();
new NbDialogOperator("About").closeByButton();
*/
try {
plugin.start(gameData, world);
screen.wait("/Resources/playerStart.png");
} catch (FindFailed ex) {
System.out.println("PlayerStart failed!");
}
Assert.assertEquals(1, world.size());
try {
screen.wait("playerMoveForward.png");
screen.type("wwwwwwww");
} catch (FindFailed ex) {
System.out.println("Player movement failed!");
}
try {
screen.wait("playerTurnRight.png");
screen.type("dddddddd");
} catch (FindFailed ex) {
System.out.println("Player turn failed!");
}
}
我在第一個screen.wait()
上獲得了一個空指針,因此路徑不正確,而且我也不知道如何獲得正確的指針。 我嘗試使用的圖像的完整路徑是:
C:\Users\Jesper\Documents\NetBeansProjects\AsteroidTEST\AsteroidsTEST\application\src\test\java\Resources\playerStart.png
您可以使用ImagePath.setBundlePath
靜態方法定義Sikuli路徑,如下所示:
ImagePath.setBundlePath("C:/temp/sikulipatterns/"); //insert your own path instead
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.