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

control_tree_view command "GetText" return Error when using pyautoit module, return None when using win32com module #23

Open
michealchew opened this issue Jul 31, 2018 · 0 comments

Comments

@michealchew
Copy link

michealchew commented Jul 31, 2018

Hi Author,

I have the issue to get the HPE Service Manager 9 x86 version control tree view text and it returns Error (pyautoit) (Python x64) or empty string (win32com) while it has no issue to get the same control tree view text in AutoIT. Besides of GetText command, "Expand" is working fine with the same command in both pyautoit and win32com.
Working: autoit.control_tree_view("HPE Service Manager", "SysTreeView321","Expand",extras1="#0")

Both AutoIT and Python are using the same DLL files.

Kindly advice on this.

Thank you

Br,
Yoong Loong

Python Code (pyautoit):
import autoit
sm9_title = "HPE Service Manager"
panel_control = "SysTreeView32"

autoit.control_tree_view(sm9_title, panel_control','GetText',extras1="#0|#0")

output:
Traceback (most recent call last):
File "C:/Python/2018/hpe/hpe.py", line 115, in
hp.open_favorite()
File "C:/Python/2018/hpe/hpe.py", line 75, in open_favorite
c = autoit.control_tree_view(sm9_title,panel_control,'GetText',extras1="#0|#0")
File "C:\Python27\lib\site-packages\pyautoit-0.4-py2.7.egg\autoit\autoit.py", line 80, in wrapper
raise AutoItError(err_msg)
AutoItError: Window/Control could not be found

Python Code (win32com):
import win32com.client

autoit = win32com.client.gencache.EnsureDispatch("AutoItX3.Control")
autoit.WinActivate("HPE Service Manager")
a = autoit.ControlTreeView("HPE Service Manager", "", "SysTreeView321", "GetText", "#0|#0", "")
print repr(a)

output:
u''

AutoIT Code:
$hwnd = WinActivate("HPE Service Manager")
$a = ControlTreeView($hwnd,'','SysTreeView321','GetText','#0')
consolewrite($a & @crlf)

output:
Connection - PROD

@michealchew michealchew changed the title control_tree_view command "GetText" return None control_tree_view command "GetText" return Error when using autoit module, return None when using win32com Jul 31, 2018
@michealchew michealchew changed the title control_tree_view command "GetText" return Error when using autoit module, return None when using win32com control_tree_view command "GetText" return Error when using pyautoit module, return None when using win32com Jul 31, 2018
@michealchew michealchew changed the title control_tree_view command "GetText" return Error when using pyautoit module, return None when using win32com control_tree_view command "GetText" return Error when using pyautoit module, return None when using win32com module Jul 31, 2018
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