简体   繁体   English

QTP无法创建ActiveX对象

[英]QTP Cannot Create ActiveX Object

While working on script, I am facing this issue. 在编写脚本时,我遇到了这个问题。

I can't post the whole code but this is a sample that does the samething that I wrote myself; 我不能发布整个代码,但这是一个与我自己写的相同的样本;

Dim qtpApp
Set qtpApp = createObject("QuickTest.Application")
qtpApp.Launch

I have also tried this: 我也试过这个:

Set qtpApp = createObject("QuickTest.application")

And This: 和这个:

Set qtpApp = createObject("Quick Test.Application")

But I Keep Getting "Active X Component cant create object. on Line x: "Set qtpApp = createObject("QuickTest.Application")" 但我继续获取“Active X Component无法创建对象。在第x行:”设置qtpApp = createObject(“QuickTest.Application”)“

Any help appreciated. 任何帮助赞赏。 Thanks. 谢谢。

The correct prog-id is the one you tried first "QuickTest.Application" . 正确的prog-id是您首先尝试的"QuickTest.Application"

The probable cause for this is that QTP isn't installed correctly on your machine. 可能的原因是您的计算机上未正确安装QTP。 To verify if this is the case 验证是否是这种情况

  1. Try launching QTP manually 尝试手动启动QTP
  2. Check that the following key exists in the registry HKEY_CLASSES_ROOT\\QuickTest.Application\\CLSID 检查注册表HKEY_CLASSES_ROOT\\QuickTest.Application\\CLSID存在以下项
  3. 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 ) 从注册表中获取classid并检查它的密钥是否存在于HKEY_CLASSES_ROOT\\CLSID (或者如果它是64位机器HKEY_CLASSES_ROOT\\Wow6432Node\\CLSID
  4. Verify that under this key the LocalServer32 points to "QtpAutomationAgent.exe" under QTP's bin directory 验证在此项下, LocalServer32指向QTP的bin目录下的“QtpAutomationAgent.exe”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM