1

Could some one help me in getting the below task done. It will be great help.

Ex:

I have a Test Script in Test Lab in a particular path in QC.

I need to develop a OTA, which will provide me 'All Runs' of the Test Script present in the path that I give. Say, I have 20 scripts in a path "Path1"(Basically the Test Lab path). So when i give this path as input, can i get all the scripts present in it and all their execution Runs. Ex: A test script 1234 is initially "Failed", then next day if it is "Passed". Then I need to get both these statuses out from Qc for all the Test Scripts.

Is this possible? I knew, we need to access the RUN table for the scripts in the given path. But could some one help me.

Thank you in advance..!

Amicable
  • 3,115
  • 3
  • 49
  • 77
user1692355
  • 15
  • 1
  • 4

1 Answers1

1

First you need to get the test set in which your scripts are located. (The example below is in Ruby, but it should be no problem to adapt it. @tdc is the TDConnection object):

test_set_tree_manager = @tdc.TestSetTreeManager
test_set_folder = test_set_tree_manager.NodeByPath("Root\\Some\\Path\\To\\Lab\\Folder")
test_set_list = test_set_folder.FindTestSets("Name of test set")
test_set = test_set_list.Item(1)

Then you need to get the test instances (TSTest) from which you want to get the runs:

test_set_factory = test_set.TSTestFactory
found_test_instances = test_set_factory.NewList("")

Finally, get all the runs from some test instance:

test_instance = found_test_instances.Item(1)
run_factory = test_instance.RunFactory
runs = run_factory.NewList("")

runs is a List which contains all the test runs of test_instance.

Roland
  • 1,220
  • 1
  • 14
  • 29
  • Thank you for your efforts.But I am not able to arrive at a solution.Pls help me. part of my code.But it never returns any value. 'Set tsf = tdc.TestSetFactory' Set treeManager = tdc.TestSetTreeManager Set tSetFolder = treeManager.NodeByPath(UserForm1.TextBox5.Value) Set TestSetList = tSetFolder.FindTestSets("My Test Set Name") Set Tset = tSetFolder.Item(1) Set testSetFact = Tset.TSTestFactory Set TestSetTestsList = testSetFact.NewList("") test_instance = TestSetTestsList.Item(1) Runs = RunF.NewList("") 'RunF as RunFactory Sheet2.Range("A" & temp).Value = Runs' – user1692355 Mar 24 '14 at 06:17
  • I am sorry, unable to code format. I tried to code format with bakticks but it didnt work, Please forgive. – user1692355 Mar 24 '14 at 06:19
  • I forgot the line `run_factory = test_instance.RunFactory` to get the RunFactory of the test instance. Does this help? If not: where exactly does your code break? Do you get the right test set and test instance? – Roland Mar 24 '14 at 08:44
  • The code breaks at the line: **test_instance = TestSetTestsList.Item(1)** in the code i have given you. My path is being read correctly but the line which sets the Test Set Name is not showing me the Test set Name after being set. In your code, the third line should set the Test Set Name i give, but when see in the watch window, it is not showing me the value. but the code is not breaking there it breaks at the '7th line' of your code. – user1692355 Mar 24 '14 at 11:01
  • Set tsf = tdc.TestSetFactory Set treeManager = tdc.TestSetTreeManager Set tSetFolder = treeManager.NodeByPath(UserForm1.TextBox5.Value) Set TestSetList = tSetFolder.FindTestSets("Bonuse Center Removal_AO User") Set Tset = TestSetList.Item(1) Set testSetFact = Tset.TSTestFactory Set TestSetTestsList = testSetFact.NewList("") test_instance = TestSetTestsList.Item(1) Set RunF = test_instance.RunFactory Runs = RunF.NewList("") Sheet2.Range("A" & temp).Value = Runs – user1692355 Mar 24 '14 at 11:03
  • Thank you for your help Roland. But could you help me sort out the issue. – user1692355 Mar 24 '14 at 11:04
  • So you don't find the test instance in your test set. Do you find the right testset (e.g. check whether the `Tset.Name` property is what you expect). Maybe there is something wrong with the path (do you use backslashes?). Does this test set contain any test instances? Do they have runs? Maybe you find something helpful in the OTA API documentation—there are examples for finding test instances (see the documentation for the TSTest Object). – Roland Mar 24 '14 at 13:08
  • Thank You Roland. I got the thing working a bit and hope a little tweak will complete my work. Thank you so much for your help. – user1692355 Mar 26 '14 at 14:38