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

could you give a example about windows 11, or pywinauto doesn't work with windows 11? #1375

Open
yllgl opened this issue Feb 11, 2024 · 0 comments

Comments

@yllgl
Copy link

yllgl commented Feb 11, 2024

Expected Behavior

run successfully

Actual Behavior

Traceback (most recent call last):
  File "c:\Users\lgl\Desktop\tempCodeRunnerFile.python", line 23, in <module>
    common_files = app.ProgramFiles.ItemsView.get_item('Common Files')
  File "D:\Python38\lib\site-packages\pywinauto\controls\uia_controls.py", line 1344, in get_item
    raise RuntimeError(
RuntimeError: Only absolute paths allowed - please start the path with \

Short Example of Code to Demonstrate the Problem

from pywinauto import Desktop, Application

Application().start('explorer.exe "C:\\Program Files"')

# connect to another process spawned by explorer.exe
# Note: make sure the script is running as Administrator!
app = Application(backend="uia").connect(path="explorer.exe", title="Program Files")

app.ProgramFiles.set_focus()
common_files = app.ProgramFiles.ItemsView.get_item('Common Files')
common_files.right_click_input()
app.ContextMenu.Properties.invoke()

# this dialog is open in another process (Desktop object doesn't rely on any process id)
Properties = Desktop(backend='uia').Common_Files_Properties
Properties.print_control_identifiers()
Properties.Cancel.click()
Properties.wait_not('visible') # make sure the dialog is closed

Specifications

  • Pywinauto version:0.6.8
  • Python version and bitness:3.8
  • Platform and OS:windows 11
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