Region.observe: want to pause other actions (e.g. main script) while handling event
I am using Sikuli for test automation purposes and I am trying to use Region.
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 one the handler is called..?
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Josh for more information if necessary.