New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Cadet 1st Class
Cadet 1st Class
455 views

Changing the Status of the Test Case when it gets copied

Hi

We have a requirement, where the copied test case should have the design status to be reset as  'New' (We have added new values to the Design status field)

Detailed Scenario:

1. Upload test cases with status as 'New' (Manual test cases)

2. Change the Value of Design status field as 'Sent for Peer Review' for a few test cases

3.Copy the test case which updated design status

Result: The design status of the copied test case should be 'New' instead of 'Sent for Peer Review'

 

Please advise on how we can achive this via workflow customization;

Thanks in advance

0 Likes
5 Replies
Highlighted
Admiral
Admiral

I would imagine you would set a default value to that Design Status field in the Test_New event.  Look into the Project Administrators Guide for more reference.

 

0 Likes
Highlighted
Cadet 1st Class
Cadet 1st Class

Hi Sheyenne

 

Thank you for your reply, yes that would work for newly created test cases.  (We are infact using that option , by defalult New test case's design status would be 'New') we are copying and pasting a test case, and in that scenario, the design status is same as that of the test case from which it is being copied from.

 

0 Likes
Highlighted
Fleet Admiral
Fleet Admiral

There is no easy way of doing that I believe. Neither Test_New, Test_MoveTo nor Test_AfterPost are triggered when you copy a test.

One thing you could try is overriding the Paste command. Analyze the contents of the clipboard and use the OTA API to create the new tests, copying the information from the source test. Not so easy but probably viable.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
Highlighted
Cadet 1st Class
Cadet 1st Class

Thank you Jan

Are there any sample codes available?

Should I trigger the Copy action itself? If so where can I find the name of that inbuilt action?

Please help

 

Thanks

0 Likes
Fleet Admiral
Fleet Admiral

In the Copy action you don't know yet where you want to paste the test, so you should probably go for the Paste action.

You can always find out the Action names by inserting "MsgBox ActionName" into ActionCanExecute. In this case it would be "TestPlanTree.Paste".

To get the contents of the clipboard, try:

   Set objHTML = CreateObject("htmlfile")
    text = objHTML.ParentWindow.ClipboardData.GetData("text")
    MsgBox text
    Set objHTML = Nothing
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
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.