Most "captures" show up as file names not pics

Asked by Roland Prancan

After some issues in closing Sikuli app I had to "Force Kill". Now when I open .sikuli file most of the pics show up as file names and not their picture representations. is there any way to get them all to show up as pics?

Question information

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

What system? Newest Sikuli version?

This usually happens, when Sikuli cannot find the images at startup (reopening the scripts that where open at last shutdown) or when an existing script is opened in the IDE (this is the only time, when Sikuli tries to show the image thumbnails).

So check, wether the respective images are present in the .script folder.

Another action might be to reset the Sikuli parameter storage according to faq 1766.

Revision history for this message
Roland Prancan (rprancan) said :
#2

Man I'm really hosed now. I can't get Sikuli to quit. I have to use the forced quit from Mac OSX. I removed ~/org.sikuli.ide.plist
. I've even rebuilt sikuli from scratch. Doesn't help.

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

--- Man I'm really hosed now
I really feel with you.

But if you do not give more information, I can only feel with you, but not help you.

What OSX?

Newest Java version?

What are you doing with Sikuli? script example?

Using the IDE unittest feature?

You might send me your stuff zipped together with additional information to my mail at https://launchpad.net/~raimund-hocke. Since I am Mac (Lion), I could have a deeper look at it.

Revision history for this message
Roland Prancan (rprancan) said :
#4

Thanks again for getting back to me, RaiMan.

I'm running Mac OSX 10.6.8
Sikuli X-1.0rc3
Java 1.6.0_29

And I am usin the unittest feature.

The other thing I noticed is that in the directory where this code lives
there is a file called
*somefile.sikuli* and it doesn't show all the pic files. I have to go into
console window to see them.

Here is a code snippet ...

*#!/usr/bin/env python*
*# encoding: utf-8*
*"""*
*TestHTMLTest.py*
*
*
*Created by Roland Prancan on 2012-01-05.*
*Copyright (c) 2012 __J__. All rights reserved.*
*"""*
*import time*
*import sys*
*import os*
*import unittest*
*import HTMLTestRunner*
*print "hello"*
*closeApp("/Applications/Titanium Studio/TitaniumStudio.app")*
*
*
* *
*class BDTests(unittest.TestCase):*
* *
* def setUp(self):*
* print("setting things up")*
* *
* openApp("/Applications/Titanium Studio/TitaniumStudio.app")*
* *
* *
* def testSeaTow_A_OpenAppTest(self):*
* print ("Running SeaTowOpenAppTest")*
* *
* if exists("Selectaworks.png",60):*
* click("1325879855448.png")*
* wait("1325879507847.png",140) *
* Run = ("1325879507847.png")*
* wait(Run,100)*
* click(Run)*
* wait(Pattern("1327330724855.png").similar(0.60),100)*
*# if
exists(Region(294,26,1146,825).inside().find("SeaTowRealwo-2.png"),30):*
*# print("Found SeaTow Location field")*
*# currentLocation =
find(Region(294,26,1146,825).inside().find("SeaTowRealwo-2.png"))*
*#
 click(currentLocation.inside().find(Pattern("1327330724855.png").similar(0.60)))
*
* click(Pattern("1327330724855.png").similar(0.60))*
* if exists("Imreadweathe.png",5):*
* click("1327330293931.png")*
* print "SeaTow Ready" *
* *
*
*
*
*
* def testSeaTow_B_MainTest(self):*
* print ("running SeaTowMainTest")*
*
*
* if exists("1327090804023.png"):*
* click("1327090804023.png")*
* name = (Region(1095,170,331,584))*
* if exists("NBITIB.png",3):*
* type("a.png","Joe Boater")*
*
*
*"every file before this is a picture, every file after is as is"*
* click("1327090924818.png")*
* *
* elif exists("JcoBcator.png",3):*
* name.highlight(3)*
* name.click("P9JcoBcator.png")*
* wait(3)*
* name.click("JoeBoateil.png")*
* click(Pattern("1325778351799.png").similar(0.88))*
* click(Pattern("1325775338673.png").similar(0.82))*
* type(Pattern("a.png").similar(0.90),"Joe Boater")*
* click(Pattern("1327091137028.png").similar(0.78))*
*.*
*.*
*.*
*.*

*
suite = unittest.TestLoader().loadTestsFromTestCase(BDTests)
*
*
file_location = "/Users/rprancan/Work/SikuliScripts/Sea-Tow/Results/"
*
*
file_name = "Report_Sikuli_08a3363a49_2.html"
*
*
# split the filename into name and extension
*
*
fname, ext = os.path.splitext(file_name)
*
*
# use year_month_day_hour_min_sec (24 hour format)
*
*
timestamp = time.strftime('%Y_%m_%d_%H_%M_%S')
*
*
# rebuild the filname
*
*
new_filename = fname + timestamp + ext
*
*
print( new_filename )
*

*

*

*
outfile = open((file_location + new_filename),"w")
*
*
runner =
HTMLTestRunner.HTMLTestRunner(verbosity=2,stream=outfile,title='Test
Report',description= new_filename)
*
*
#openApp("/Applications/TitaniumStudio/TitaniumStudio.app")
*
*
runner.run(suite)
*
*
closeApp("/Applications/Titanium Studio/TitaniumStudio.app")
*
*

*
*
print "Goodby"
*
*
#if __name__ == '__main__': HTMLTestRunner.main()
*

*

*
* *

On Tue, Jan 31, 2012 at 3:30 AM, RaiMan <
<email address hidden>> wrote:

> Your question #186050 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/186050
>
> Status: Open => Needs information
>
> RaiMan requested more information:
> --- Man I'm really hosed now
> I really feel with you.
>
> But if you do not give more information, I can only feel with you, but
> not help you.
>
> What OSX?
>
> Newest Java version?
>
> What are you doing with Sikuli? script example?
>
> Using the IDE unittest feature?
>
> You might send me your stuff zipped together with additional information
> to my mail at https://launchpad.net/~raimund-hocke. Since I am Mac
> (Lion), I could have a deeper look at it.
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/sikuli/+question/186050
>
> You received this question notification because you asked the question.
>

--
Roland Prancan
617-990-4773
<email address hidden>

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

Ok, then everything should work.

Some comments on your answer:

--- And I am usin the unittest feature.
That was not what I meant: you are using J(P)ython's unit test module together with the HTMLTestRunner. I meant Sikuli IDE's unit test feature available at View -> UnitTest. But now I know, that you do not use it (it has many problems).

--- *The other thing I noticed is that in the directory where this code lives there is a file called *somefile.sikuli* and it doesn't show all the pic files. I have to go into console window to see them.
*somefile.sikuli* is not a file in the common sense, it is a bundle (a folder whose content is not visible in the Finder. If you want to check the content in the Finder: right click -> Show BundleContent).
I guess when saying console, you are talking about a Terminal session - right?
If you open somefile.sikuli in the Sikuli IDE, all picture files, that are present in the bundle somefile.sikuli should be shown as thumbnails.

--- in the directory where this code lives
Now I guess we are talking about the file TestHTMLTest.py. This is a plain J(P)python file and cannot be opened or processed in Sikuli's IDE. It can only be run with a correctly configured Jython interpreter and the "from sikuli import *" is missing.
And I cannot see, where the referenced image files are stored.
If this should be run with Sikuli IDE or via "java -jar sikuli-script.jar", it has to be in a folder structure:
-- TestHTMLTest.sikuli
----- referenced image files
----- TestHTMLTest.py

--- looks strange
since your stuff generally looks strange and your answer does not clarify things (the code is hard to read):
Do yourself a favor and help me to help:
put everything, that you think should work, but does not, into one folder and zip it. Then send the zip to my mail.
Into the mail copy&paste the full path to the folder.

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

solved by user:

somehow in the .sikuli bundle folder the respective images shown as filenames had vanished (not finally clear why).

repairing this by deleting one of these statements brought the following thumbnails back.

It is not clear, why all following images after one that is missing are shown as filenames despite the fact, that they are there in the bundle.

I could not reproduce this situation with the newest build from http://sikuli.org/hudson/job/Sikuli-IDE-Mac/