Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot perform the test calculator #75

Open
emabcede30 opened this issue Nov 19, 2024 · 1 comment
Open

cannot perform the test calculator #75

emabcede30 opened this issue Nov 19, 2024 · 1 comment

Comments

@emabcede30
Copy link

emabcede30 commented Nov 19, 2024

hello, i'm having trouble using pywinauto_recorder.py for the simple calculator example. see traceback:

(base) C:\Users\PC>conda activate pyrecord

(pyrecord) C:\Users\PC>cd C:\Users\PC\Desktop\pyrecord\pywinauto_recorder

(pyrecord) C:\Users\PC\Desktop\pyrecord\pywinauto_recorder>python pywinauto_recorder.py
Reading configuration file: C:\Users\PC\Pywinauto recorder\config.ini
Window filtering mode: ignore_windows
Ignored windows: []

COMPTYPES CACHE FOLDER: D:\anaconda\envs\pyrecord\lib\site-packages\comtypes\gen
PYWINAUTO RECORDER FOLDER: C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder
Reading configuration file: C:\Users\PC\Pywinauto recorder\config.ini
Window filtering mode: ignore_windows
Ignored windows: []
def show(self):
Your Pywinauto recorder is up to date.
command--->
def hide(self):
<---command
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)
['Traceback (most recent call last):\n', '  File "C:\\Users\\PC\\Desktop\\pyrecord\\pywinauto_recorder\\pywinauto_recorder\\core.py", line 55, in get_wrapper_path\n    while wrapper != wrapper_top_level_parent:\n', '  File "D:\\anaconda\\envs\\pyrecord\\lib\\site-packages\\pywinauto\\base_wrapper.py", line 669, in __ne__\n    return not self == other\n', '  File "D:\\anaconda\\envs\\pyrecord\\lib\\site-packages\\pywinauto\\base_wrapper.py", line 662, in __eq__\n    return self.element_info == other.element_info\n', '  File "D:\\anaconda\\envs\\pyrecord\\lib\\site-packages\\pywinauto\\uia_element_info.py", line 360, in __eq__\n    return bool(IUIA().iuia.CompareElements(self.element, other.element))\n', "_ctypes.COMError: (-2147220991, 'An event was unable to invoke any of the subscribers', (None, None, None, 0, None))\n", '\nDuring handling of the above exception, another exception occurred:\n\n', 'Traceback (most recent call last):\n', '  File "C:\\Users\\PC\\Desktop\\pyrecord\\pywinauto_recorder\\pywinauto_recorder\\recorder.py", line 839, in run\n    wrapper_path = get_wrapper_path(wrapper)\n', '  File "C:\\Users\\PC\\Desktop\\pyrecord\\pywinauto_recorder\\pywinauto_recorder\\core.py", line 60, in get_wrapper_path\n    traceback.print_exc()\n', "NameError: name 'traceback' is not defined\n"]
command--->
Recording in file: C:\Users\PC\Pywinauto recorder\recorded Tue Nov 19 14_19_14 2024.py
<---command
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)
command--->
🔎🔴🔴🔴🔴🔴Traceback (most recent call last):
  File "C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder\player.py", line 1051, in playback
    exec(compiled_code)
  File "", line 7, in <module>
  File "C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder\player.py", line 733, in drag_and_drop
    move(element_path1, duration=duration, mode=mode, timeout=timeout)
  File "C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder\player.py", line 577, in move
    unique_element = find(element_path, timeout=timeout)
  File "C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder\player.py", line 435, in find
    return _cached_find(full_element_path, get_native_window_handle(), timeout=timeout)
  File "D:\anaconda\envs\pyrecord\lib\site-packages\cachetools\__init__.py", line 717, in wrapper
    v = func(*args, **kwargs)
  File "C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder\player.py", line 312, in _cached_find
    return _find(full_element_path, timeout)
  File "C:\Users\PC\Desktop\pyrecord\pywinauto_recorder\pywinauto_recorder\player.py", line 332, in _find
    raise FailedSearch(msg)
pywinauto_recorder.player.FailedSearch: No element found with the UIPath '||List' after 10 s of searching.
Press Enter to continue...
<---command
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)

i've install pywinauto_recorder by cloning it in a local repo and installed it with pip install -e . im using windows 10 and the current dependencies installed are:

Package Version Editable project location


cachetools 5.5.0
colorama 0.4.6
comtypes 1.4.8
enum34 1.1.10
exceptiongroup 1.2.2
iniconfig 2.0.0
keyboard 0.13.5
mouse 0.7.1
overlay-arrows-and-more 0.5.0
packaging 24.2
pillow 11.0.0
pip 24.2
pluggy 1.5.0
pyperclip 1.9.0
pytest 8.3.3
pywin32 308
pywinauto 0.6.8
pywinauto_recorder 0.6.8 c:\users\pc\desktop\pyrecord\pywinauto_recorder
RapidFuzz 3.10.1
setuptools 75.1.0
six 1.16.0
thefuzz 0.22.1
tomli 2.1.0
wheel 0.44.0

this is the contents of the "recorded Tue Nov 19 14_19_14 2024.py"

# encoding: utf-8

from pywinauto_recorder.player import *


with UIPath(u"||List"):
	drag_and_drop(u"", u"|Pane->||Pane->Type here to search||Button")

with UIPath(u"Search||Window"):
	with UIPath(u"Search||Pane->Search||Pane->Results||List->Recent||Group->Recent||List->Calculator, App||ListItem"):
		click(u"Calculator Delete Calculator, App from recent||Button")

with UIPath(u"Calculator||Window"):
	with UIPath(u"Calculator||Window->||Custom->||Group"):
		click(u"Number pad||Group->One||Button")
	with UIPath(u"Calculator||Window"):
		click(u"||Custom->||Group->Standard operators||Group->Plus||Button")
		click(u"||Custom")
	with UIPath(u"Calculator||Window->||Custom->||Group"):
		click(u"Number pad||Group->Two||Button")
	with UIPath(u"Calculator||Window"):
		click(u"||Custom->||Group->Standard operators||Group->Equals||Button")
		click(u"Close Calculator||Button")

with UIPath(u"||List"):
	right_click(u"")

with UIPath(u"Context||Menu"):
	click(u"Stop recording\t\tCTRL+ALT+R||MenuItem")
Copy link

Thank you very much for sharing this first issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant