【发布时间】:2016-05-13 09:44:28
【问题描述】:
我正在使用 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
【问题讨论】:
-
可能是,但该链接对我没有任何帮助。
标签: java automation sikuli