Cannot launch UFT from VB script on Win 8

On Win 7 or previous version of Windows, the VB script below can be used to invoke QTP/UFT

Dim qtApp

Dim qtTest

Dim qtResultsOpt

Dim qtAutoExportResultsOpts

Set qtApp = CreateObject("QuickTest.Application")

qtApp.Launch ‘ Start UFT

qtApp.Visible = True

However, on Win 8, if UFT was set to "Run as Administrator" under "Properties" – "Compatibility", the error below will prompt out:

Error: Unspecified error

Code: 80004005

Source: (null)

It indicates that the line of "Set qtApp = CreateObject("QuickTest.Application")" causes the error.

This is because DCOM is not set properly.

The steps below will fix the issue:

1. Run "dcomcnfg.exe".

2. Select "Component Services" – "Computers" – "My Computer" – "DCOM Config".

3. Select "QuickTest Professional Automation".

4. Right click and select "Properties".

5. In the properties dialog box, switch to "Identify" tab

6. Select "The launching user" instead of "The interactive user"

Run the script again, and the issue should be resolved.

Advertisements

2 thoughts on “Cannot launch UFT from VB script on Win 8

  1. Yogesh

    unfortunately this did not work for me. I was able to launch QTP successfully on Windows 7. but once when I restarted the system, I started getting unspecified error for Set qtApp = CreateObject(“QuickTest.Application”) line.
    I have tried restarting machine multiple times after this. I still get the same error every time. Any idea what else can I try?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s