question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The same wrappers accessed in two different ways do not have the same parent.

See original GitHub issue

Expected Behavior

The output should be:

True
True

The first True is because wrapper_maximize_button1 == wrapper_maximize_button2 So I expect wrapper_maximize_button1.parent() == wrapper_maximize_button2.parent()

Actual Behavior

The output is:

True
False

False is the result of wrapper_maximize_button1.parent() == wrapper_maximize_button2.parent()

Steps to Reproduce the Problem

  1. Execute code

Short Example of Code to Demonstrate the Problem

import pywinauto

pywinauto.application.Application().start(cmd_line="explorer.exe")
desktop = pywinauto.Desktop(backend='uia', allow_magic_lookup=False)
if desktop['File Explorer'].is_maximized():
	desktop['File Explorer'].restore()

window = desktop.windows(title='File Explorer', control_type='Window')[0]
wrapper_maximize_button1 = window.descendants(title='Maximize')[0]

pt = wrapper_maximize_button1.rectangle().mid_point()
wrapper_maximize_button2 = desktop.from_point(pt[0],pt[1])

print(wrapper_maximize_button1 == wrapper_maximize_button2)			# True
print(wrapper_maximize_button1.parent() == wrapper_maximize_button2.parent())	# Should be True

Specifications

  • Pywinauto version: 0.6.8
  • Python version and bitness: 3.8.3 64bit
  • Platform and OS: PC Windows 10

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
vasily-v-ryabovcommented, May 17, 2021

No more ideas for now. Let’s keep it for a long term. My current priority is 0.7.0. Sorry.

0reactions
beuaaacommented, May 18, 2021

No problem if it takes time to solve this issue. I’m also looking forward to the release of version 0.7.0. Keep up the good work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrapper Classes in Java - GeeksforGeeks
A Wrapper class is a class whose object wraps or contains primitive data types. When we create an object to a wrapper class,...
Read more >
Cross-window communication - The Modern JavaScript Tutorial
Two URLs are said to have the “same origin” if they have the same protocol, domain and port. These URLs all share the...
Read more >
Wrappers to the Rescue - Brian Foote
We have used method wrappers to construct several program analysis tools: a coverage ... The other property is that the new forwarding methods...
Read more >
Make buttons (hyperlink) same-size as child in parent wrapper ...
I tried many things with flex and grid but I just can't get it to work. I don't want to use width, max-width,...
Read more >
Class extension - Method wrapping and Chain of Command
When you wrap a method, you can also access public and protected ... The wrapper method must have the same signature as the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found