ALM Workflow Script Customization - Manual Run Window (1856 Views)
Reply
Advisor
voxnor
Posts: 16
Registered: ‎01-30-2013
Message 1 of 8 (1,856 Views)
Accepted Solution

ALM Workflow Script Customization - Manual Run Window

Greetings -

 

I am attempting to hide several system fields on the manual Run window (such as Baseline, Host, etc). 

 

If I place the following code in the Manual Runner Script module, in the Run_FieldChange subroutine, I can hide them after a value is changed on the form:

 

Run_Fields.Field("RN_HOST").IsVisible=False

 

However, I would like them hidden from the start. The issue is that the Manual Run window appears to open and runs the 'RunTestsManually' script, which is in a seperate module (The Test Lab module). If I include the above line of code in that script, I simply get an error letting me know that it does not have a Run_Fields in it's scope (it reports that it needs an object).

 

I have spent a few hours now searching around the net and seeing if I can get at those fields from the Tets Lab module using TDConnection but so far no luck.

 

Thanks for any help you can offer!

-Steven

Honored Contributor
Massimo De Rosa
Posts: 656
Registered: ‎03-02-2009
Message 2 of 8 (1,834 Views)

Re: ALM Workflow Script Customization - Manual Run Window

Hi,

I don't know ALM but Manual Run Module is always a bad beast.

 

You could try to work with DialogBox sub in Common Module.

 

Ciao,

Massimo.

Advisor
voxnor
Posts: 16
Registered: ‎01-30-2013
Message 3 of 8 (1,826 Views)

Re: ALM Workflow Script Customization - Manual Run Window

[ Edited ]

Thanks for the reply Massimo.

 

I spent today trying the dialog box, and some other areas. Finally I popped a message box in just about every module I thought might be called.

 

It turns out you can accomplish this in the EnterModule sub in Common Script. When that script is called, it has scope on the module that is running it. So, when the Manual Run window opens and calls EnterModule with the module name "ManualRun" I can catch it and call a routine that changes the visibility on run fields.

 

Code:

 

Inside of EnterModule :

 

If ActiveModule = "ManualRun" Then
HideManualRunFields
End If

 

 

Inside of ManualRun module script:

 

Sub HideManualRunFields
Run_Fields.Field("RN_PINNED_BASELINE").IsVisible=false
Run_Fields.Field("RN_BPTA_CHANGE_DETECTED").IsVisible=false
Run_Fields.Field("RN_OS_CONFIG").IsVisible=false
Run_Fields.Field("RN_OS_BUILD").IsVisible=false
Run_Fields.Field("RN_RUN_ID").IsVisible=false
Run_Fields.Field("RN_VC_VERSION_NUMBER").IsVisible=false
Run_Fields.Field("RN_BPTA_CHANGE_AWARENESS").IsVisible=false
Run_Fields.Field("RN_TEST_CONFIG_ID").IsVisible=false
Run_Fields.Field("RN_DRAFT").IsVisible=false
Run_Fields.Field("RN_HOST").IsVisible=false
Run_Fields.Field("RN_OS_NAME").IsVisible=false
Run_Fields.Field("RN_OS_SP").IsVisible=false
End Sub

 

 

This of course could be extended to do other operations on the fields of the manual run box as well.

 

Cheers,

 

Steven

Honored Contributor
Massimo De Rosa
Posts: 656
Registered: ‎03-02-2009
Message 4 of 8 (1,803 Views)

Re: ALM Workflow Script Customization - Manual Run Window

Good work Steven!!!

 

You do the right thing to examine various Sub.

 

Ciao, Massimo.

Occasional Advisor
Shreyance
Posts: 15
Registered: ‎02-28-2012
Message 5 of 8 (1,696 Views)

Re: ALM Workflow Script Customization - Manual Run Window

Hi Steven,

 

I am new to workflow customization and i found your post helpful and wanted to extend your logic to do other operations on fields under the Run module, however i was not able to implement is successfully

 

Our requirement is that when we open the manual run window ,  i have to populate the Run Name field with a value of a custom field which is on the test lab.

 

I followed your logic, only inside the function instead of making the fields not visible, i wrote the code to assign value to the Run Name field.

 

Sub HideManualRunFields
Run_Fields("RN_RUN_NAME")= TestSet_Fields("CY_USER_01").Value 

end Sub

 

But i did not work. I tried to just echo the value to ensure that i am getting to this function

 

Sub HideManualRunFields
msg TestSet_Fields("CY_USER_01").Value 

end Sub

 

does not work but 

 

Sub HideManualRunFields
msgbox "Manual Run"

end Sub 

works fine.

 

Can you help me out on this ?

 

Thanks,

Shreyance

Honored Contributor
Trudy Claspill
Posts: 3,779
Registered: ‎09-09-2010
Message 6 of 8 (1,689 Views)

Re: ALM Workflow Script Customization - Manual Run Window

The reason your code to echo the value didn't work is because it uses incorrect syntax

 

It should be

Sub HideManualRunFields
msgbox TestSet_Fields("CY_USER_01").Value 
end Sub

 

[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.)
Occasional Advisor
AIS - QC10
Posts: 11
Registered: ‎10-12-2010
Message 7 of 8 (1,522 Views)

Re: ALM Workflow Script Customization - Manual Run Window

Thanks Steven,

 

I was struggling to hide fields in the Manual Test Runner. This post saved my day.

 

Cheers.

Honored Contributor
Massimo De Rosa
Posts: 656
Registered: ‎03-02-2009
Message 8 of 8 (1,517 Views)

Re: ALM Workflow Script Customization - Manual Run Window

Hi,

 

the problem in your piece of code is that TestSet_Field(... object is no more recognize in ManualRun module. What you can get directly are something like Run_Fields(.. or Step_Fields(...

 

so to do what you need the sub could be something like:

 

Sub HideManualRunFields

Dim myTestSet

'retrieve the TestSet from the Run object

set myTestSet = TDConnection.TestSetFactory.Item(Run_Fields("RN_CYCLE_ID").Value) 

 

'Fill the RunName with the value of the TestSet Custom Field
Run_Fields("RN_RUN_NAME")= myTestSet.Field("CY_USER_01")

 

'destroy the TestSet object

set myTestSet = Nothing

 

end Sub

 

 

Hope this helps.

 

Ciao,

Massimo.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.