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
Answer by Rich Text · Jan 31, 2014 at 06:59 PM
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)\HP\QuickTest Professional\bin\QTAutomationAgent.exe" /regserver
B. Check the registry settings:
Check that the following key exists in the registry HKEY_CLASSES_ROOT\QuickTest.Application\CLSID
Take the classid from the registry and check that the key for it exists under HKEY_CLASSES_ROOT\CLSID (or if it's a 64 bit machine HKEY_CLASSES_ROOT\Wow6432Node\CLSID)
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.
Answer by Rich Text · Jan 10 at 02:53 AM
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.