簡體   English   中英

使用DSSO和XML-RPC.NET的DTM自動化

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM