Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
435 views

Test Plan Module Script

Dear,

 

I am trying to write code for following scenario and unsuccessfull so far.

 

In Test Plan module I have the test case in following folder structure:

 

FRUIT   <- Parent Folder

     APPLE   <- Sub-Folder 1

           RIPE   <- Sub-Folder 2

                  Test Case 01_Test the ripe apple    <- Test Case

 

I have created a new user field for Test module i.e. "Project".  Now, with the Test Plan Module Script code in Test_MoveTo, I want to update the "Project" field in the Test Case: "Test Case 01_Test the ripe apple" with the top most parent folder name i.e. "FRUIT".

 

Please advice me here.

 

 

Thanks,

Tanmay

 

 

 

 

0 Likes
3 Replies
Absent Member.. Absent Member..
Absent Member..

Show us the code you have written so far.

 

You are going to have to implement code using the Open Test Architecture API, I believe.

 

There is no field in the Test entity that stores the full folder path for the test.

 

There is a field that stores the ID of the folder in which the test directly resides. You will have to take that information, and then use that to figure out that folder's parent folder, and so on, to find the ultimate parent folder.

 

There are a couple of ways to accomplish this, but all of them require OTA code I think.

 

Maybe somebody else has a better idea.

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
Absent Member.
Absent Member.

Sounds like you need to use SQL Analytics (which I am terrible at).  Look up "connect by prior" or "connect by path"

 

 

 

Another thought process I had (not an exact answer but might help you navigate through the tree)

 


-- This will show the Upper Folder Name
-- Notice CF_ITEM_PATH will look like AAAAAA, AAAAAB, AAAAAC
SELECT *
FROM CYCL_FOLD
WHERE LENGTH(CF_ITEM_PATH) = 6

 

-- This will show Sub Folder 1 Name
-- Notice CF_ITEM_PATH will look like AAAAAAAAA, AAAAAAAAB, AAAAAAAAC
SELECT *
FROM CYCL_FOLD
WHERE LENGTH(CF_ITEM_PATH) = 9

 

-- This will show Sub Folder 2 Name
-- Notice CF_ITEM_PATH will look like AAAAAAAAAAAA, AAAAAAAABAAA, AAAAAAAACAAA
SELECT *
FROM CYCL_FOLD
WHERE LENGTH(CF_ITEM_PATH) = 12

 

From here you can link the following to get your specific test.
CYCL_FOLD.CF_ITEM_ID TO CYCLE.CF_ITEM_ID
CYCLE.CY_CYCLE_ID TO TESTCYCL.TC_CYCLE_ID
TESTCYCL.TC_TEST_ID TO TEST.TS_TEST_ID

Once you have the specific test_id you can then update your "project" field

Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

Thanks for your reply valkorum!!

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.