0

I'm using SikuliX to test my game. Here's the code I'm running:

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!");
    }

}

I'm getting a null pointer on first screen.wait(), so the path is not right, and I have no idea how to get the right one. The full path of the image I'm trying to use is:

C:\Users\Jesper\Documents\NetBeansProjects\AsteroidTEST\AsteroidsTEST\application\src\test\java\Resources\playerStart.png
Eugene S
  • 6,709
  • 8
  • 57
  • 91
Jesper
  • 2,644
  • 4
  • 30
  • 65
  • Possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – rmlan May 12 '16 at 22:48
  • 1
    Might be, but that link doesn't help me at all. – Jesper May 12 '16 at 22:53

1 Answers1

0

You can define your Sikuli path using ImagePath.setBundlePath static method like this:

ImagePath.setBundlePath("C:/temp/sikulipatterns/"); //insert your own path instead
Eugene S
  • 6,709
  • 8
  • 57
  • 91