Absent Member.
Absent Member.
791 views

How to use Workflow to prevent testers from executing tests in Closed Test Set

Jump to solution
I am wondering what code I can use to stop Testers executing any tests in a Closed Test Set?

I have tried many things myself, basically hacking away and not getting anywhere, given the limited information and semi-related examples I can find.

From what I understand, I need to modify the workflow scripts for the following:
RunTests, RunTestsManually, RunTestSets

... but I don't know how to construct the valid script for it 😕
0 Likes
1 Solution

Accepted Solutions
Fleet Admiral
Fleet Admiral
Here is a way to do it:

1. Add a global variable on top of the common workflow:

Dim testSetClosed
testSetClosed = False

2. In TestSet_MoveTo, add the following to give the global variable a value:

If TestSet_Fields("CY_STATUS").Value = "Closed" Then
testSetClosed = True
Else
testSetClosed = False
End If

3. In ActionCanExecute, add the following to prevent running the tests:

If ActionName = "act_run" OR ActionName = "act_run_test_set" Then
If testSetClosed Then
ActionCanExecute = False
Exit Function
End If
End If
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

8 Replies
Fleet Admiral
Fleet Admiral
Here is a way to do it:

1. Add a global variable on top of the common workflow:

Dim testSetClosed
testSetClosed = False

2. In TestSet_MoveTo, add the following to give the global variable a value:

If TestSet_Fields("CY_STATUS").Value = "Closed" Then
testSetClosed = True
Else
testSetClosed = False
End If

3. In ActionCanExecute, add the following to prevent running the tests:

If ActionName = "act_run" OR ActionName = "act_run_test_set" Then
If testSetClosed Then
ActionCanExecute = False
Exit Function
End If
End If
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

Absent Member.
Absent Member.
Thank you, that seems to work pretty well actually, I just added a message box in for informing the user.

It was quite a different solution to what I was trying to do.

One thing I need still to do after that is stop the user just changing the status of the test directly.

I can switch that off directly through privileges by taking away ability to Modify Test in Test Set - Status 🙂
0 Likes
Vice Admiral Vice Admiral
Vice Admiral

Hi Jan

 

where can I find ActioncanExecute function ??

 

How to add global variable in workflow ??

0 Likes
Absent Member.. Absent Member..
Absent Member..
ActionCanExecute is one of the workflows in the Common Script section of the workflow editor.

The Administrator Guide provides information on how to declare a global workflow script variable.
[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.)
0 Likes
Vice Admiral Vice Admiral
Vice Admiral

Thanks trudy I am able to do it. 

 

But If I click the Drop down list from Run button and click on Run with Manual Runner its still working. 

0 Likes
Absent Member.. Absent Member..
Absent Member..
Run With Manual Runner may generate a different action name then the ones specified in the sample code. To find out the name of an action that is run based on what you click in the UI, insert the line
Msgbox ActionName
into the ActionCanExecute function. This will pop-up a message box for every UI action that generates an action call, and will do it for every user, so only put this code in when you will be the only one on the system. And take it out as soon as you have finished trying UI actions to see what action calls they generate.

Also, show us all the code changes you have made, and tell us what version and patch level of the product you are using.
[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.)
0 Likes
Vice Admiral Vice Admiral
Vice Admiral

Hi Trudy, 

 

Thanks for your suggestion I am now able to restrict testers from executing tests if the test set is closed. 

 

Is there any way to show a pop up message like " Test set is closed " if they click on the Run button ? ? 

 

0 Likes
Absent Member.. Absent Member..
Absent Member..
Put a Msgbox command into your workflow customization in the same place where you detect that the condition is met.
[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.)
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.