通过WatiN测试记录设置WatiN COM接口

问题描述

| 使用PHP代码
$iface=new COM(\"WatiN.COMInterface\");
$ie = $iface->CreateIE(\"http://www.google.com\");
$ie->TextField($iface->FindByName(\"q\"))->TypeText(\"watin\");
$ie->Button($iface->FindByName(\"btnG\"))->Click();
来自http://watintestrecord.sourceforge.net/WatiNCOM.html 结果为
com_exception: Failed to create COM object \'WatiN.COMInterface\': Invalid Syntax
其他COM喜欢
$word = new COM(\"word.application\") or die(\"Unable to instantiate Word\");
工作正常。 有人可以逐步给出如何使WatiN与PHP 5.3一起使用的手册     

解决方法

        听起来您还没有为COM互操作注册WatiNCOM程序集。 尝试从包含下载文件的目录中的命令行运行以下命令。
regasm WatiNCOM.dll
此命令在此处记录:regasm