TransWikia.com

Programatically (C#) update QC/ALM Test Plan > Test Script tab content

Stack Overflow Asked by user4619697 on November 16, 2021

I am trying to programmatically (C#) overwrite the default generated contents of the Test Script tab for a QC/ALM VAPI-XP-TEST Test Plan.

I have been able to create/update the content of the Details, Design Steps, Parameters, etc tabs using code from the web, but cannot find refs on how to do the Test Script tab.

One Answer

SOLUTION:

  1. run the first 6 lines of code in step 5 to create a VAPI-XP-TEST.

  2. In the created test > Test Script tab, go to the referenced Script path in Windows Explorer. Looks something like this:

    C:Usersuser_idAppDataLocalTempTD_80ip_addresshex_codeTest

  3. open any child node folder path all the way until you see a test.sr file

  4. Copy the test.sr file to the same folder as your VB Script file

  5. change C# code as follows:

    
         TestFactory TF = qc.TestFactory; // qc is the ALM connection
         Test test = (Test)TF.AddItem(System.DBNull.Value);
         test["TS_NAME"] = "test name";
         test["TS_TYPE"] = "VAPI-XP-TEST";
         test["TS_SUBJECT"] = "Test Plan folder path/node id";
         test.Post();
         // add your script.vbs to Test Script tab of Test Plan test. 
         var es = test.ExtendedStorage; 
         es.ClientPath = "folder of your script.vbs and copied test.sr file"; 
         es.Save("script.vbs, test.sr", true);
     
  6. re-run your C# code and check Test Script tab of Test Plan test to see your VB script.

Answered by user4619697 on November 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP