0

プログラムで ALM のテスト スイートを起動しようとしています。コードを実行するとき (マシンがテスト ランナーとして機能するとき)、ローカル マシンで指定されたテスト スイートを実行しても問題はありません。ただし、リモートサーバーを指定して上記のテストスイートを実行しようとすると、問題が発生します。ここに投稿されたコードとエラーメッセージ:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TDAPIOLELib;


        // Connect to ALM
        ITDConnection itdc = new TDConnection();
        itdc.InitConnectionEx(url);
        itdc.ConnectProjectEx(domain, projectName, username, pswd);

        if (itdc.ProjectConnected)
        {
            List<string> testInfo = new List<string>();

            string testFolder = "Root\\<Folder>\\<Folder>";
            testSetName = "<TestSuite>";

            TestSetFactory tsFactory = (TestSetFactory)itdc.TestSetFactory;
            TestSetTreeManager tsTreeMgr = (TestSetTreeManager)itdc.TestSetTreeManager;

            TestSetFolder tsFolder = (TestSetFolder)tsTreeMgr.get_NodeByPath(testFolder);
            List tList = tsFolder.FindTestSets(testSetName, false, null);
            TestSet testset = tList[1];

            TSScheduler scheduler = testset.StartExecution("<RemoteServerName>"); // Contain server name unless local
            // scheduler.RunAllLocally = true; // Included when ran local
            scheduler.Run();                
        }

「スケジューラ」宣言行で受け取るエラー メッセージは、「クラスが登録されていません (HRESULT からの例外: 0x80040154 (REGDB_E_CLASSNOTREG))」です。

ローカル マシンと実行しようとしたマシンの両方に OTAClient.dll を登録しました。

任意の提案をいただければ幸いです。

  • 次のステップ
    • 老いも若きも司祭を呼んでください。
4

2 に答える 2

2

I was already using

TSScheduler scheduler = testSet.StartExecution("");

We had a working solution in QC10, but recently upgraded to QC12. Installing the connectivity located at

yourALMURL.com/qcbin/TDConnectivity_index.html

allowed us to use the COM object in VS2013 / C#, connect to QC etc but would fail with the same error you had on the code above.

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Eventually we found that you also need to 'register your client' by going to tools/client registration:

https://yourALMURL.com/qcbin/CommonMode_index.html

Running IE as admin, and installing the components on that page.

I hope this helps someone :)

于 2014-11-06T12:17:01.060 に答える