【问题标题】:DTM automation using DSSO and XML-RPC.NET使用 DSSO 和 XML-RPC.NET 实现 DTM 自动化
【发布时间】:2010-10-26 18:52:35
【问题描述】:

尝试使用有关该主题的唯一且唯一的文档来自动化 WHQL 测试:http://www.microsoft.com/whdc/devtools/wdk/dtm/dtm_dsso.mspx

我已经使用了示例代码,并且能够连接、列出设备等。从那里我创建了一个新项目,一个 .NET 2.0 C# 类:

using System;
using System.Reflection;
using System.IO;
using CookComputing.XmlRpc;
using Microsoft.DistributedAutomation.DeviceSelection;
using log4net;

class WhqlXmlRpcService : XmlRpcService
{
    private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
    public static DeviceScript deviceScript;

    [XmlRpcMethod("connect")]
    public Boolean Connect(String dtm)
    {
        Boolean retVal = false;
        deviceScript = new DeviceScript();
        try
        {
            deviceScript.ConnectToNamedDataStore(dtm);
            retVal = true;
        }
        catch (Exception e)
        {
            Log.Debug("Error: " + e.Message);
        }

        return retVal;
    }
}

我正在使用 XML-RPC.NET 创建由 IIS 托管的服务器(使用 ASP.NET 2.0)。 DTM Studio 安装在 C:\Inetpub\wwwroot\xmlrpc\bin 中,与我的班级目标所在的位置相同,以确保我引用的十几个 .dll 没有分辨率问题(按照 DSSO 的指示文档)。我尝试将必要的 DSSO 库添加到 GAC 以避免这种情况,但并非所有这些库都具有强名称。因此,尽管能够看到它需要链接的所有库(并且 Studio 应用程序功能很好地安装在非标准位置),但尝试 .ConnectToNamedDatastore("nameofDTM") 仍然会导致以下结果:

xmlrpclib.Fault: <Fault 0: 'Could not connect to the controller to retrieve information.  Several issues can cause this error including missing or corrupt files from the installation, running the studio application from a folder other than the install folder, and running an application that accesses the scripting APIs from a folder other than the installation folder.'>

我正在从安装文件夹访问脚本 API,因为它与我的 Web 服务 .dll 的目录相同,并且文件没有损坏,因为如果我将带有 DSSO 示例代码的 .exe 粘贴在同一目录中目录我可以看到它在调试器中连接得很好。

我对此束手无策,无法在任何地方找到有用的 DTM/DSSO 信息来源。

任何人过去做过类似的事情,或者在自动化他们的 WHQL 测试方面取得了任何成功?

【问题讨论】:

    标签: c# xml-rpc


    【解决方案1】:

    我无法使用 ASP.NET Web 服务 .dll 使其工作,但是,我能够通过使用 .NET 中的 HttpListener 类使我的 XML RPC 服务器可用来访问 DSSO API。如果您将目标应用程序部署到与 DTM Studio 相同的目录中,则一切正常。

    有关如何将 XML-RPC.NET 与 HttpListener 一起使用的示例,请参阅: http://www.cookcomputing.com/blog/archives/000572.html

    注意:“ListenerService”自上述链接发布以来已被合并到最新版本的 XML-RPC.NET 中。它可以在 CookComputing.XmlRpc.XmlRpcListenerService 下找到

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-22
      • 1970-01-01
      • 2011-07-21
      • 2011-03-23
      • 2021-09-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多