【问题标题】:How to set Sikuli path如何设置Sikuli路径
【发布时间】: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


【解决方案1】:

您可以使用ImagePath.setBundlePath 静态方法定义您的 Sikuli 路径,如下所示:

ImagePath.setBundlePath("C:/temp/sikulipatterns/"); //insert your own path instead

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-14
    • 2014-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多