使用 Nunit 的 AutoIt 脚本

AutoIt Script using Nunit

虽然 运行 我的脚本通过 Visual Studio (Selenium-C#),但我用于打开对话框的 AutoIt 脚本完美运行,但是当 运行 来自 Nunit(.Net) 的相同脚本时) 客户端,相同的测试失败并出现以下错误:

ReportAppeal.MainTestRunner.OpenFile("Email"):
System.Runtime.InteropServices.COMException : Retrieving the COM class factory for component with CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

我做错了什么吗?

好的解决方案是:

  1. 打开regedit*32 (c:\windows\syswow64\regedit)
  2. HKEY_CLASSES_ROOT\AppID
    中搜索 AutoItX 我在 HKEY_CLASSES_ROOT\AppID{6E8109C4-F369-415D-AF9A-2AEEFF313234}
  3. 中找到了它
  4. 创建一个名为 DllSurrogate
  5. 的空白 REG_SZ(字符串)条目

出于某种原因,这完全解决了问题。 在 Windows 7 - 64 位

中工作

参考:
How to use a 32 bit COM object on Windows Server 2008 (works on 2008 R2 but non 2008)