[1.0.1] .observe quits before it should be finished --- fixed in 1.1.0

Bug #1199882 reported by Tames McTigue on 2013-07-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

--- fixed in 1.1.0

observe is completely revised and improved in 1.1.0


--- should be tested with 1.0.1: since observe is revised and has more debug messages.

I'm trying to create a script that tests an installer. For some reason it quits about half way through even though I can't see any reason for it to. It runs up until after it sees and runs the "install_path_page" handler. Once it runs that handler, it quits with "[info] Exit code: 0"

This is running on Windows Server 2012 Standard using 64-bit Java 1.7.0_25 and 64-bit Sikuli IDE 1.0.0 with the "SupplementalObserveOnlyOnce" update.

After posting this as a question, RaiMan mentioned that it will stop if it has handled all the .onAppear images. I tried adding a new .onAppear image that would never show up. The script still behaves exactly the same.

Here is what I have so far. I plan on having observe run forever eventually and have the last handler stop the observation:

installer_path = 'C:\\Users\\Administrator\\Desktop\\my_windows_setup.exe'
license_company = 'company'
license_name = 'name'
license_count = 1
license_key = 'xxxxxxxxxxxxxxxxxxxxxxxx'
postgres_password = 'xxxxxxx'

def click_next():

def intro_page(event):

def eula_page(event):

def license_page(event):
    type(license_company + Key.TAB)
    type(license_name + Key.TAB)
    type(str(license_count) + Key.TAB)

def install_path_page(event):

def features_page(event):

def postgresql_path_page(event):

def postgresql_password_page(event):
    type(postgres_password + Key.TAB)

def web_ports_page(event):

def ready_to_install_page(event):

def begin_watching():
    es_installer = App(installer_path)
    wait("1373389889359.png", FOREVER)

    reg = Region(App('Setup').window(0))
    reg.onAppear("1373389041327.png", intro_page)
    reg.onAppear("1373389063530.png", eula_page)
    reg.onAppear("1373389092077.png", license_page)
    reg.onAppear("1373390507593.png", install_path_page)
    reg.onAppear("1373392574702.png", features_page)
    reg.onAppear("1373390778484.png", postgresql_path_page)
    reg.onAppear("1373391295577.png", postgresql_password_page)
    reg.onAppear("1373391322733.png", web_ports_page)
    reg.onAppear("1373391349515.png", ready_to_install_page)


RaiMan (raimund-hocke) on 2013-07-10
Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
RaiMan (raimund-hocke) wrote :

Thanks for testing and evaluating.
At least the observe has some quirks ;-)

Today I went through the observe implementation and added some features and a better (LOL) debug log.

It will be available with the service update 1.0.1 end July.

- in the handler function you can decide to repeat the onAppear when coming back from the handler
a time value in seconds waits for the target to vanish again before searching again (default region.AutoWaitTimeout)
this repeated onAppear is of value when you run the observe in the background.
(not restricting to the first appear in the RC3 version may lead to fancy loops ;-)

- e.getCount() gives you a number how many times, the handler was visited

- you can say e.stopObserver() instead of e.region.stopObserver()

--- different image sets
This is best done with some images.sikuli, that is imported and has images stored in variables with some naming conventions or other structures, that allow to select a set depending on the current runtime situation.

RaiMan (raimund-hocke) on 2013-07-16
Changed in sikuli:
status: Fix Committed → In Progress
description: updated
RaiMan (raimund-hocke) on 2013-07-18
tags: added: fkt-observe
RaiMan (raimund-hocke) on 2014-01-12
summary: - .observe quits before it should be finished
+ [1.0.1] .observe quits before it should be finished
RaiMan (raimund-hocke) on 2014-01-12
Changed in sikuli:
status: In Progress → Fix Committed
RaiMan (raimund-hocke) on 2015-09-17
summary: - [1.0.1] .observe quits before it should be finished
+ [1.0.1] .observe quits before it should be finished --- fixed in 1.1.0
description: updated
Changed in sikuli:
importance: High → Critical
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions