beuaaa / pywinauto_recorder

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

recording both click and send_key #60

Open aditya11ad opened 1 year ago

aditya11ad commented 1 year ago

Hi,

if using calculator and clicking some buttons and also passing values from keybord , then only click is being recorded.

is there any way to capture both .

Thanks in advance .

github-actions[bot] commented 1 year ago

Thank you very much for sharing this first issue.

beuaaa commented 1 year ago

Hi,

Could you copy in your message the recorded file ?

aditya11ad commented 1 year ago

that can be done. but it won't be automation then.

beuaaa commented 1 year ago

I would like to study your use case. There is probably a problem with Pywinauto Recorder. Having the file generated by Pywinauto Recorder would help me a lot to solve it.

aditya11ad commented 1 year ago

hi, activities performed on calculator :

click -> 5 click -> multiply press -> 2 click ->equal

generated script :

from pywinauto_recorder.player import *
with UIPath(u"Calculator||Window"):
    with UIPath(u"Calculator||Window->||Custom->||Group"):
        click(u"Number pad||Group->Five||Button")
    with UIPath(u"Calculator||Window->||Custom->||Group->Standard operators||Group"):
        click(u"Multiply by||Button")
        click(u"Equals||Button")
beuaaa commented 1 year ago

Thank you for your comprehensive description of this use case.

I've understood the problem: pressing key 2 is not captured by Pywinauto Recorder. This is because Pywinauto Recorder only captures keystrokes when a field is filled in by the user.

To make this use case work, a solution would be to enable the capture of all keyboard events.

aditya11ad commented 1 year ago

hi, thanks for the quick response.

so how to enable the capture of all keyboard events.

beuaaa commented 1 year ago

This requires the following changes to be made in Pywinauto Recorder: