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.

I can't read the inner text of the object HwndWrapper

See original GitHub issue

I wanna get text of the object HwndWrapper but when I try get the data with the next code doesn’t return none:

from pywinauto.application import Application
app = Application().start(cmd_line u'"C:\\app.exe"')
role = app[u'Datos Generales']
table = role[u'1']
dataTable = table.texts()

The previus code doesn’t return none.

I appreciate your collaboration with a solution Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vasily-v-ryabovcommented, May 8, 2019

Thanks! It looks like custom grid control that has no standard interfaces for GUI automation. The app was built using MFC framework (it’s pretty old but mostly nice to automate by "win32" backend as well).

Technically it should be possible to implement custom wrapper for this grid if we had source code of this control (not necessary the source code of the whole app).

Otherwise I can suggest only workaround like .type_keys("^a^c") (press Ctrl+A, then press Ctrl+C) and then get text data from clipboard using module pywinauto.clipboard. Of course, it’s only grabbing the data, not the full automation.

0reactions
AlbertChanXcommented, Apr 28, 2020

You may try followings,

for c in role.children():
     print(c)
     print(c._element_info.name)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to access windows controls inside pywinauto's ...
Trying to set or get Text for TextBox (windows control) inside pywinauto.controls.hwndwrapper.hwndwrapper by using SWAPY, I have Class Name of ...
Read more >
pywinauto.controls.hwndwrapper - Read the Docs
This method sends WM_* messages to the control, to do a more 'realistic' mouse click use click_input() which uses mouse_event() API to perform...
Read more >
Cannot find the UI element corresponding to this selector
This selects an application named notepad.exe with “Font” in the title. Go ahead, save the file under a new name - your selector...
Read more >
There is a problem with the XML that was received ... - MSDN
ProtocolException: There is a problem with the XML that was received from the network. See inner exception for more details. ---> System.Xml.
Read more >
Unable to get text from object - Katalon Studio
Aside: I believe (can't be bothered to go look it up) the option.text property will contain a copy of the innerText. But either...
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