beuaaa / pywinauto_recorder

A record-replay tool to automate GUI via pywinauto
https://pywinauto-recorder.readthedocs.io/
MIT License
131 stars 24 forks source link

generate pywinauto python code? #27

Open SaetreS opened 3 years ago

SaetreS commented 3 years ago

Hi,

The program has great potential and to increase it's useability it would generate pywinauto python code directly instead of pywinauto_recorder code. This would enable using the program for projects where you want to do more than just click some pre-defined buttons.

I'm not sure how much work this would be and you might have already given this some thoughts.

github-actions[bot] commented 3 years ago

Thank you very much for sharing this first issue.

beuaaa commented 3 years ago

Hi @SaetreS,

Pywinauto recorder generates Python code with functions that return Pywinauto wrappers. It is possible to do everything that Pywinauto can do with these wrappers.

I found the search for graphical elements with the classic tools (Inspect.exe, PrintControlIdentifier, ...) quite tedious. That's why I developed the Pywinauto recorder mini language. The goal is to have an easy to read Python code and to be able to identify graphical elements easily (with wildcards in an element path and other small functions). Once the element is identified you can access the Pywinauto wrapper and program in the classic way with Pywinauto.

However it is a good idea to be able to generate other styles of Python code (Pywinauto recorder code, Pure Pywinauto code, XPath, etc). I had thought about it but I didn't do it because of lack of time. But if someone can implement it that would be great!