← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #255605]: [1.1.0] ImageLocator.setBundlePath is deprecated

 

Question #255605 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/255605

    Status: Open => Answered

RaiMan proposed the following answer:
When running in Java, at startup there is no BundlePath set yet, hence it is null.
As a convenience in this case (using getBundlePath before having set it), I set it to the current working folder.
hence images being in the current working folder will be found without saying anything (you will only get the information)

so you might instantly start with a

scr.find("images/image1.png");

having a folder
C:/Users/User/MyProjects/testproject/images

I will add another convenience:
In Maven projects, you would usually have your images in src/main/resources, so I will use this when I detect a project having this, instead of the working folder.

I will change the message, to better explain the situation and adapt the
javadocs.

Thanks for finding.

In your case you should set the BundlePath to something that makes sense
at the beginning.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.