Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
PBS_1 Absent Member.
Absent Member.
2547 views

Using TS_SUBJECT in TestFactory.Filter

I got a strange behavior searching a particular test in workflow script...
Cutting off non interesting code, I use:

_______________________________________
Set NewObjTestFactory = NewConnection.TestFactory
Set NewTestFilter = NewObjTestFactory.Filter
NewTestFilter.Filter.Clear

' Using the Name of the Test... ok, work
NewTestFilter.Filter("TS_NAME") = """"& aTest.Name &""""
' Using the subject (aka the 'tree' path)
ThisTestPath = aTest.Field("TS_SUBJECT").Path
NewTestFilter.Filter("TS_SUBJECT") = """"& ThisTestPath&""""

' Can use
'NewTestFilter.Filter("TS_NAME") = """CHECK THIS"""
'NewTestFilter.Filter("TS_SUBJECT") = """Subject\TEST\new"""

msgbox NewTestFilter.Text
_______________________________________

Now, the strange: if the 'path' (TS_SUBJECT) is 1 depth (the test is directly under the 'Subject' root) or under a leaf (e.g Subject\TEST) all work fine... in the msgbox i will read the complete filter.
If i try to use a level above (e.g. Subject\TEST\new) the TS_SUBJECT filter was ignored! Only the filter using the name is used and visualized.
The subject search string is correct (i take it from a test entity) but also try to write something at hand doesn't work.

Where i go wrong?
Have someone registered the same behavior?

Ah, i'm using QC 10.0 patch 7

Many thanks
0 Likes
5 Replies
WW239455 Absent Member.
Absent Member.

Re: Using TS_SUBJECT in TestFactory.Filter

At a guess, "new" doesnt exist.
Try it in the QC UI first - hit the "Copy Filter Settings" button, paste to notepad to see how the QC does it. (Also ensure the error handler is off while testing script)
0 Likes
PBS_1 Absent Member.
Absent Member.

Re: Using TS_SUBJECT in TestFactory.Filter

No way.
The 'new' folder obviously exist ;)
In the GUI, setting the filer like (reading frome the pane of tree view):
Filter: Subject[^Subject\TEST\new^];Test Name[= "prova cp"];
This work (see pic).
Copying in the notepad:
[Filter]{
TableName:TEST,
ColumnName:TS_NAME,
LogicalFilter:"= \"prova cp\"",
VisualFilter:"= \"prova cp\"",
NO_CASE:
}
{
TableName:TEST,
ColumnName:TS_SUBJECT,
LogicalFilter:\00000012\^Subject\TEST\new^,
VisualFilter:\00000012\^Subject\TEST\new^,
NO_CASE:
}

[Grouping]

No way to use it in workflow... :(
I've tried 'some' other character combination but nothing...

Another thing: have someone tried to make a filter using a folder name with space? Simply doesn't work! :S
Yes, create a folder "My new test folder" under Subject of Test Plan module and try to do a filter in GUI to retrive all test in that folder only... good luck.

Something wrong...

10x
0 Likes
WW239455 Absent Member.
Absent Member.

Re: Using TS_SUBJECT in TestFactory.Filter

If you havnt already, try with carets:
NewTestFilter.Filter("TS_SUBJECT") = "^Subject\TEST\new^"
Not quite the same effect as quotes (will select subfolders too)
0 Likes

Re: Using TS_SUBJECT in TestFactory.Filter

Wondering if you found a solution to this?  I am having the same issue, as soon as I put a folder name in my filter that contains a space I get EVERYTHING... Any help would be appreciated.

 

Set myfilter = TstFactory.Filter()
myfilter.Filter("TS_SUBJECT") = fpath
'Get a list of all test cases for your specified path
Set TestList = myfilter.NewList()

My Test Plan Structure:

Subject

     OneSAP

          String Test   <======   This is where it goes bonkers if in the fpath

                Test 1

                Test 2

0 Likes
Vladimir Skrbek Acclaimed Contributor.
Acclaimed Contributor.

Re: Using TS_SUBJECT in TestFactory.Filter

For me it working fine. I am using ALM 12.55, with version do you use?

I have this Test Plan folder:

Subject -> aaa:

  ts

Subject -> UnderRoot:

  TUR1

  TUR2

Subject -> UnderRoot -> Folder with space:

  test under folder with space

Subject -> UnderRoot -> Folder with space -> F1:

  TF1

 

And when I use this vbscript (tdc is the TDConnection):

----

Set myfilter = tdc.TestFactory.Filter
myfilter.Filter("TS_SUBJECT") = "^Subject\UnderRoot^"
'Get a list of all test cases for your specified path
Set TestList = myfilter.NewList()
msgbox myfilter.Text
msgbox "Počet testů: " & TestList.Count

----

It shows me this:

[Filter]{
TableName:TEST,
ColumnName:TS_SUBJECT,
LogicalFilter:\00000013\^Subject\UnderRoot^,
VisualFilter:\00000013\^Subject\UnderRoot^,
NO_CASE:
}

and 4 tests

 

If I change it to: 

myfilter.Filter("TS_SUBJECT") = "^Subject\UnderRoot\Folder with space^"

it shows me this:

---

[Filter]{
TableName:TEST,
ColumnName:TS_SUBJECT,
LogicalFilter:\00000025\^Subject\UnderRoot\Folder with space^,
VisualFilter:\00000025\^Subject\UnderRoot\Folder with space^,
NO_CASE:
}

---

and 2 tests.

It is correct behaviour.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.