pywinauto/pywinauto

Add something like DoActionUntil() to make things stable

Open

#50 opened on Jul 2, 2015

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Python (4,425 stars) (654 forks)batch import
Priority-Lowenhancementhelp wanted

Description

Sometimes window messages and mouse/keyboard actions are not really handled by test application because of short non-responding state or another reason.

We need to introduce some stabilization feature for such cases. Unstable code:

taskbar.Clock.ClickInput()
ClockWindow = taskbar.explorer_app.Window_(class_name='ClockFlyoutWindow')
ClockWindow.Wait('visible') # WindowNotFound exception may be raised here from time to time

Stable modification proposal (ideally we should simply wrap unstable code with stabilizer):

ClockWindow = taskbar.explorer_app.Window_(class_name='ClockFlyoutWindow')
DoActionUntil(
    taskbar.Clock.ClickInput(),
    ClockWindow.Wait('visible')
)

Let's discuss how it can be done. ;)

Contributor guide