← Back to team overview

sikuli-driver team mailing list archive

[Question #183655]: Threading problems with Region.observe

 

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

I am using Sikuli for test automation purposes and I am trying to use Region.observe(background=True) to create a dialog handler registry.  The purpose of this registry is you can define how you want certain unexpected dialogs to be handled that happen to show up during a test (eg. Windows/Flash upgrade dialogs, Crashes).  Some times these dialogs are non-critical and other times they should fail the test.

This is timeline I see of what is happening:
----
1) Main Thread started
2) Register dialog (Minimize console windows) -> Region.onAppear() -> Region.observe() -> Thread A Created
3) Register dialog (Close windows upgrade request) -> Region.onAppear() -> Region.observe() -> Thread B Created
4) Start application under test
5) Perform actions
6) Windows Upgrade dialog appears -> Call handler using Thread B (sikuli)
 a) Pause main thread while handling dialog
 b) handle the dialog (close window, whatever)
 c) Resume main thread
 d) Return from handler
7) continue with test

Between step 6-7 we need to pause the main thread so that we can handle any dialogs that might mess up our test.  

I am encounter a problem though.. if I pause the main thread and then inside thread B start calling any sikuli functions it seems to be hanging intermittently.. Which leads me to believe that threadB is dependant on the MainThread some how .. 

I am not sure a useful purpose of a background observer if the main program execution cannot be stopped..?

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