Robert Plant

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2010-03-08
23:08
791 views
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 😕
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 😕
1 Solution
Accepted Solutions
Jan Czajkowski

Fleet Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2010-03-09
08:53
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
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!]
[Please do not contact me off line for receiving support. Use the forum!]
8 Replies
Jan Czajkowski

Fleet Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2010-03-09
08:53
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
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!]
[Please do not contact me off line for receiving support. Use the forum!]
Robert Plant

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2010-03-09
23:56
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 🙂
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 🙂


Vice Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-08-12
17:48
Hi Jan
where can I find ActioncanExecute function ??
How to add global variable in workflow ??


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-08-12
19:57
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.
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.)
(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.)


Vice Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-08-12
22:14
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.


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-08-14
03:36
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.
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.)
(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.)


Vice Admiral
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-08-15
00:12
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 ? ?


Absent Member..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-08-16
01:41
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.)
(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.)