2016-05-12 26 views
0

私はSikuliXを使ってゲームをテストしています。ここで私が実行しているコードです:Sikuliのパスを設定する方法

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()にNULLポインタを取得していますので、パスは適切ではない、と私は右のいずれかを取得する方法は考えています。私が使用しようとしている画像の完全なパスは次のとおりです。

C:\Users\Jesper\Documents\NetBeansProjects\AsteroidTEST\AsteroidsTEST\application\src\test\java\Resources\playerStart.png 
+0

可能な重複は何NULLポインタ例外がありますどのように私はそれを修正するのですか?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – rmlan

+1

おそらく、しかし、そのリンクは私を助けません。 – Jesper

答えて

0

あなたはこのようImagePath.setBundlePath静的メソッドを使用してSikuliパスを定義することができます。

ImagePath.setBundlePath("C:/temp/sikulipatterns/"); //insert your own path instead 
[の
関連する問題