Search code examples
pythonautomationautomated-testsui-automationpywinauto

Pywinauto taking long time for operations


I'm having troubles with automating filtering in a certain window of a program, that i'm working on. A window consists of listview, few comboboxes and few edits. When i select certain position in the combobox2 and click "filter", then listview shows results matching with that checkbox. But here i have problem. After clicking filter manually, program loads results for a short time (~2 seconds), but if i do it with pywinauto, then it takes up to ~10 seconds before it moves to another function which should select another position in the combobox. (even then i can click it manualy and it works fine, so it's 100% not problem with the program)

Here's example of a code which causes troubles.

user_count = 0
while user_count < 5:
    self.app[kkvat].ComboBox2.Select(user_count)
    self.app[kkvat].Filter.Click()
    user_count += 1

The problems shows up exactly at the second loop when the 2 position of combobox should be selected.

Sorry for my language, not native :(


Solution

  • The bug with timings is fixed in pywinauto 0.6.3. Please update it with pip install -U pywinauto and try your case again.