← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #179495]: onAppear and observe with Robot Framework

 

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

Peter Kim gave more information on the question:
I found out that I could simply press the home button to do the same
thing I was doing in the handler function. I renamed the handler
function to be snooze_alarm.

def snooze_alarm():
    print "in snooze_alarm"
    v.click("home.png") 

def suite_setup():
    ...
    set_alarm()
    v.onAppear("giHAIWE.png", snooze_alarm)
    v.observe(FOREVER,background=True)
    ...

def suite_teardown():
    ...
    v.stopObserver()
    ...

The main routine looks like:

suite_setup()

test_setup()
test_function1()
test_teardown()

test_setup()
test_function2()
test_teardown()

...

suite_teardown()

I get the following error message:

Exception in thread "Thread-9" Traceback (most recent call last):
 File "C:\W7\Sikuli X\sikuli-script.jar\Lib\sikuli\Region.py", line 287, in observe
 File "C:\W7\Sikuli X\sikuli-script.jar\Lib\sikuli\Region.py", line 255, in targetAppeared
TypeError: repeat_alarm() takes no arguments (1 given)

v_wait_click: could not find I4E-1.png
v_wait_click: saved the region image as C:\Sikuli\LU6200.sikuli\sikuli-scr-6209487362800751544.png

[error] 중지됨
[error] 782 번째 행에서 오류 발생
[error] 에러 메시지: Traceback (most recent call last):
 File "C:\Users\pd.kim\AppData\Local\Temp\sikuli-tmp3763259516910263046.py", line 782, in  add_contact(name,mobile_no,home_no,email,memo)
 File "C:\Users\pd.kim\AppData\Local\Temp\sikuli-tmp3763259516910263046.py", line 196, in add_contact
 v_wait_click("I4E-1.png")
 File "C:\Users\pd.kim\AppData\Local\Temp\sikuli-tmp3763259516910263046.py", line 28, in v_wait_click
 v.click(image)
 Line 29, in file C:\Users\pd.kim\AppData\Local\Temp\sikuli-tmp3763259516910263046.py

 at org.sikuli.script.Region.handleFindFailed(Region.java:420) 
at org.sikuli.script.Region.wait(Region.java:511) 
at org.python.proxies.sikuli.Region$Region$0.super__wait(Unknown Source) 
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 

org.sikuli.script.FindFailed: FindFailed: can not find I4E-1.png on the screen.
 Line 29, in file C:\Users\pd.kim\AppData\Local\Temp\sikuli-tmp3763259516910263046.py

I am using a Windows 7 32-bit PC.

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