Adding Event handler in sikuli IDE

Asked by Mujeebu Rahman

Hi,

I wanted to add event handler in my unittest module in sikuli IDE.
I just want to perform a check and handle the unexpected alert in case of AUT crashes.

If someone could provide the sample event handler code implemented in IDE, then that would be sufficient.

Regards.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Mujeebu Rahman
Solved:
Last query:
Last reply:
Revision history for this message
Mujeebu Rahman (mujeeburahman007) said :
#1

Hi ,

Any update on this query?

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

what is: "my unittest module in sikuli IDE" ??

what is: " the unexpected alert in case of AUT crashes" ??

It is always helpful to paste a relevant code snippet or some pseudo code/workflow, that illustrate your goal.

Revision history for this message
Mujeebu Rahman (mujeeburahman007) said :
#3

HI RaiMan,

what is: "my unittest module in sikuli IDE" ??
Meaning, I am using unittest scripts in the IDE,

class MyTest1(unittest.TestCase):
 def test1(self):
  try:
   some test
               except:
                        print "message"

In the above i wanted to add event handlers.

what is: " the unexpected alert in case of AUT crashes" ??
Meaning incase if Application crashes, then an event should be triggered to the user saying that the application has crashed.
Also if any unknown alert popping from the application should be able to handle by the script.

Regards.

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

you might start appropriate background observations in setup() and stop it again in teardown().

Revision history for this message
Mujeebu Rahman (mujeeburahman007) said :
#5

Hi RaiMan,

Its not clear for me, If you could provide me a sample code snippet would be helpful.

Regards.

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

setup and teardown are part of the unittest module: see the docs

for using observe: http://doc.sikuli.org/region.html#observing-visual-events-in-a-region

Come back with YOUR coding, if you have problems.

The net has surely many examples - Google is your friend.

Revision history for this message
Mujeebu Rahman (mujeeburahman007) said :
#7

Thanks Raiman.