API error trying to use QuickTest.Application
Question ID: 105264
0
0

I have a vbs file that launch QTP. This is the code I have in the file:

set qtp=CreateObject("QuickTest.Application")
qtp.launch
qtp.visible=true

When I try executing this on a Win 7 machines. I’m getting the following error when executing the VbScript:

Active X component can’t create object

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on January 31, 2014 6:57 pm
218 views
Answers (3)
1
Private answer

There are a few different things that could cause this problem. Here are a few things to check below, in order of most likely causes. This CreateObject command for QuickTest.Application only works on machines that have QTP installed on them. I have had users try to run this on a machine that didn't have QTP.

A. The QTP application doesn't have the mapping for the QTP object in the registry. To fix this, please try the following:

Go to command prompt (please launch it by right-clicking on it and selecting ''Run as Administrator'' first.

Run this command. You may need to double-check the location path of the .exe file on your Windows in case it is installed in a different location (such as 32 bit vs. 64 bit)

''C:Program Files (x86)HPQuickTest ProfessionalbinQTAutomationAgent.exe'' /regserver

B. Check the registry settings:

1. Check that the following key exists in the registry HKEY_CLASSES_ROOTQuickTest.ApplicationCLSID

2. Take the classid from the registry and check that the key for it exists under HKEY_CLASSES_ROOTCLSID (or if it's a 64 bit machine HKEY_CLASSES_ROOTWow6432NodeCLSID)

3. Verify that under this key the LocalServer32 points to ''QtpAutomationAgent.exe'' under QTP's bin director

C. Run a repair on the QTP installation in the Programs/Features section of the Windows control panel.

c. You may want your IT department to check for network delays if you are using a concurrent license with the license server. Users have encountered problems when the network is too slow and QTP requests a refresh on the license.

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on January 31, 2014 6:59 pm
0
Private answer

I did the steps. I think the repair did the trick, but it might have been the regserver step also.

Marked as spam
Posted by (Questions: 227, Answers: 22)
Answered on January 31, 2014 10:21 pm
0
Private answer

Something else I discovered recently when trying to figure out why I was getting an error trying to launch UFT via a .vbs file. Right-click on the UFT shortcut and select Properties. Next, click the Compatibility tab and make sure that 'Run as administrator' is not checked.

I had discovered that somehow mine had been checked and it was causing an elevation mis-match between the .vbs file and UFT. Once I unchecked it, UFT launched fine again without the Active X error being thrown.

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on January 10, 2017 2:53 am
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top