问题描述:

How do we reference an already opened instance of quick test application (QTP) for e.g we will use Set monDocument = GetObject("c:\report.doc") to refer an already opened MS Word file saved in c:\report.doc?

网友答案:

Just create the QTP automation object

Set qtApp = CreateObject("QuickTest.Application") 

If it's already open you'll get the existing instance, otherwise you will have to launch it.

If  Not qtApp.launched Then 
    qtApp.Launch 
End If 

Code stolen from here.

相关阅读:
Top