[python-win32] Problems with QuickTest Automation Object Model
timr at probo.com
Sat Sep 5 02:11:06 CEST 2009
Dennis Chung wrote:
> I am having problems using win32com.client with the HP QTP COM
> libraries. QTP is just another windows based application like Excel
> that exposes a COM type library for automation.
> In vbscript the COM library works fine as follows:
> Set qtp = CreateObject("QuickTest.Application")
> MsgBox qtp.Launched ' Prints True
> Using python:
> >>> import win32com.client
> >>> o = win32com.client.Dispatch("QuickTest.Application")
> >>> o.Launch
> <bound method CDispatch.Launch of <COMObject b'QuickTest.Application'>>
> >>> o.Launched
> Any idea as to why the application fails to launch when invoked with
> the python com libraries?
Yes, because you are not invoking Launch You are printing the address
of Launch. VB does not require parens on a function with no
parameters. Python does. Use this:
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32