| || |
TSTestFactory filter not working - help needed
Am trying to run the vb script to get the testcase details from a testset, by matching a filter set for testsettestfactory, with the value set to a specific testcase id. But it seams its not matching the testcase ID i gave and generating the list of testcases. Can you please help.
' create testsetree object with a reference to TestSetTreeManager
set testsettree = tdc.TestSetTreeManager
' create testfold object with the method NodeByPath of the object testsettree
set testfold = testsettree.NodeByPath("Root\project12")
' create the list testsetlist with the method FindTestSets of the object testfold
set testsetlist = testfold.FindTestSets("")
# Get the required testcase using the filter on the testset
For Each item In testsetlist
set testsetfac = item.TSTestFactory
set tcfilter = testsetfac.Filter
tcfilter.Filter("TC_USER_01") = "TC_RocketScience"
set testcaselist = testsetfac.NewList("")
For Each tc in testcaselist
Re: TSTestFactory filter not working - help needed
I think that the problem might be in the fact you are using 'tcfilter.Filter("TC_USER_01") = "TC_RocketScience"'.
Perhaps you should try using 'tcfilter("TC_USER_01") = "TC_RocketScience"' instead.
Also you retrieve the list of testcases via the following command:
set testcaselist = tcfilter.NewList()
The second thing I would like to note is that the 'set testsetlist = testfold.FindTestSets("")' command will give you an overview of all Test Sets under this specified folder, not only the immediate child Test Sets.
What about using the following piece of code:
Set tstestFilter = tdc.TSTestFactory.filter
tstestFilter("TC_USER_01") = "TC_RocketScience"
set tstestList = testfold.FindTestInstances("", False, tstestFilter)