Sikuli hanging on 2nd run of a script

Asked by Ryan

Hello,

I am running a test script on macOS where I choose a location of a folder and sikuli stores the variable for use later in the script. I am running into an issue where sikuli will correctly run the script the 1st time I run it after starting the IDE, but a 2nd run will see sikuli hide the IDE window (like normal when it runs scripts), but nothing happens. I can see that the process is active in Activity Monitor, but I need to force quit the app to use it further.

Sometimes, sikuli hangs on the 1st run of the script.

I am using Sikuli 1.1.1 2017-03-30 (I did just upgrade from the 2017-03-15 build by deleting the sikuli app and the 'App Support' folder and installing the new version fresh)

macOS Sierra 10.12.5

JDK 1.8

Here is my script:

from sikuli import * <--I have this line here because I am wanting to call this function via another sikuli script

def SDKLocation():
   Location = popFile("choose")
   Location = Location + "/_build/bin/release/"
   popup(Location)

SDKLocation()

I have noticed that if I remove the ' + "/_build/bin/release/" ' bit that the script seems to run more (about 3 or 4 times) before hanging on the next run.

Am I do something that would cause this behavior? Or is this a bug?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

I checked and it might be, that there is an issue with the popFile() feature.

I make it a bug now.
But a fix might take a while because of other priorities in the moment.

Depending on your intention, there might be another solution (parameter, input(), ...) as a workaround

Revision history for this message
Ryan (ryan-g2) said :
#2

Hi RaiMan, thanks for the response.

I was using popFile() since it allowed me to drag a folder onto the text entry field and it would paste the location of that folder so then I could capture it via the return of that text input box. I looked for a solution for this for awhile and came up with popFile. I am sure there is another way - I will just have to find it.

The reason I am aiming for the drag n drop feature is that I am working on testing a program that is continually updated and I need to have the current version as well as a few other versions available to test with. This is why I have moved away from hardcoding the path (which I have done before and the rest of my script worked fantastically!) and it also started becoming a burden to manually change the paths in my scripts when I needed to switch versions of the program I wanted to run the Sikuli script against.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Thanks for the explanation - makes sense.

Did you already check, wether the fix works for you?

Revision history for this message
Ryan (ryan-g2) said :
#4

I haven't had a chance to check yet. I am working on my Sikuli project in my spare time at work and it's been pretty busy lately.

I am hoping the get sometime soon to check it out. I get back to this thread when I get a chance. Thanks for fixing!!

Revision history for this message
Ryan (ryan-g2) said :
#5

Hi again RaiMan,

As it turns out, I found some free time today.

I downloaded the 06-04 nightly build of Sikuli 1.1.2 and installed that. I recreated the script from above and ran it - it ran perfectly multiple times in a row, so it looks fixed!

One note is that is have upgraded my system to the latest macOS beta (10.13) and it works on there. popFile gave me a slightly different text box than I was expecting (It allowed me to browse through my folder structure to choose a file or folder), but the result is what I am looking for.

My 10.12.5 partition is not wanting to boot right now, but I would expect it would be working on that OS as well.

Revision history for this message
Ryan (ryan-g2) said :
#6

Thanks RaiMan, that solved my question.