← Back to team overview

sikuli-driver team mailing list archive

[Question #173217]: Problems running unit tests from Win7 command line

 

New question #173217 on Sikuli:
https://answers.launchpad.net/sikuli/+question/173217

I am running Sikuli X 1.0rc3 on Win7 Professional x64.  My goal is to use the unit test features of Sikuli to write some automated tests.  I have built several demo unit test scripts (testing notepad and an in house app) which run fine in the Sikuli IDE, but do not run correctly from the command line.  

For example, here is a notepad test file I have written (this is the python code, obviously it has the pretty pictures in the IDE):

--------------------------------------------
notepad = App("notepad.exe")

def setUp(self):
	self.notepad.open()
	wait("UntitledNote.png", 20000)

def tearDown(self):
	self.notepad.close()
	waitVanish("UntitledNote-1.png", 20000)

def test_textarea_add_del_by_key(self):
	type("hello world")
	assert exists("helloworld.png")
	type("a",KEY_CTRL) 
	type("\n")
	assert not exists("helloworld.png")

def test_textarea_add_del_by_key_clipboard(self):
	type("hello world")
	# fill clipboard for assert
	type("a",KEY_CTRL)
	type("c",KEY_CTRL)
	assert Env.getClipboard() == "hello world"
	type("\n")
	# fill clipboard for assert
	type("a",KEY_CTRL)
	type("c",KEY_CTRL)
	assert not Env.getClipboard() == "hello world"
--------------------------------------------------

When I run this from the IDE (toggle Unit Tests from the View menu, then click the Unit Tests run button), everything runs fine and I get 2/2 tests run to completion.  However, when I run it from the command line, the tests fail with "[error] UntitledNote.png looks like a file, but can't be found on the disk. Assume it's text."  Full output below:

C:\Users\username\Desktop>"%SIKULI_HOME%\sikuli-ide.bat" -t c:\users\username\Desktop\notepad_tests.sikuli
[info] Sikuli vision engine loaded.
[info] Windows utilities loaded.
[info] VDictProxy loaded.
.[log] App.open notepad.exe(7868)
[error] UntitledNote.png looks like a file, but can't be found on the disk. Assume it's text.
[info] Text Recognizer inited.
[error] UntitledNote.png looks like a file, but can't be found on the disk. Assume it's text.
[error] UntitledNote.png looks like a file, but can't be found on the disk. Assume it's text.
...

So, it looks to me like this is some sort of pathing issue.  I have tried adding the path to the .sikuli directory to the image path as the first line of the script based on another Q&A, but that did not work.  Are there other steps I should try to troubleshoot this?

Thanks!

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