[英]DTM automation using DSSO and XML-RPC.NET
尝试使用该主题上的一个“仅”文档自动执行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的I引用没有解析问题(按照DSSO的说明) doc)。 为了避免这种情况,我尝试将必要的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相同,并且文件没有损坏,因为如果将.exe和DSSO示例代码粘贴在同一目录中,则可以看到它在调试器中连接正常。
我对此一无所知,一直无法在任何地方找到有用的DTM / DSSO信息来源。
有人在过去做过类似的事情,还是在自动化WHQL测试方面取得了成功?
我无法使用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下找到
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.