Pass global parameters between tests via Workflow.
This question is regarding passing a global variable between tests in a set instance. I looked at prior posts and FAQs (most are related to QTP actions and Param method). However, none of the solutions seemed to apply. Please see a description below.
Our tests are automated VAPI-XP, which drive TCL scripts. The QC parameter feature is only available to manual tests, so this doesn't support us.
Multiple users will run the same set. However, each user will supply a unique value for this dynamic field at set execution.
The field can not be statically defined as a user-defined field in project entities. If we define it as a test, set or test instance field, user's will potentially step on each other durng overlapping set executions.
For our purposes, consider the run as a "set instance" or set object with a global variable whose scope spans all tests. For our purposes, the field is a constant value that won't be modified from test to test.
I tried accomplishing this by modifying the workflow to have a global variable in scope for the function called, TestLab_RunTestSet. I added an input dialog box to obtain the value of the global variable from the user. I made the variable global in scope. I'm trying to determine the appropriate way to pass it between tests. I tried storing it in a "test instance" user defined field. However, I believe overlapping execution by different users will step on each other.
I tried writing it to a user defined RUN field but I'm getting errors when I access the RUN object. Is the RUN object in scope for this function? The RUN object is available for each test instance but it doesn't seem to be exposed from this function. I looked at other workflow functions and I can't see a way to pass this to each test.
Please see a sample of my workflow code. I get run time errors attempting to write to the run object. Getting Type Mismatch error. I must be overlooking something obvious and/or doing something clearly illegal in this code. Advice is greatly appreciated.
It seems to me that this is a very common operation that people would need to do. During a run, retrieving a dynamic variable from the user and treat it as a global variable to use in all the tests. This global is a unique for each user and set/run instance, without collisions during execution of the same set of tests, at the same time.
prompttext = "This is an input box!"
titletext = "INPUT function"
returntext = InputBox(prompttext, titletext, "Any text you wish...")
reservation = returntext
msgbox("reservation: " & reservation)
TestSetTest_Fields("TC_USER_01").Value = returntext
MsgBox("TCUSER1: " & TestSetTest_Fields("TC_USER_01").Value)
Run_Fields("RN_USER_01").Value = reservation <<<<<< Fails here
MsgBox("Run Field: " & Run_Fields("RN_USER_01").Value) <<<<<< doesn't like this either
' Set tdc = TDConnection
'Set TSFactory = tdc.TestSetFactory
'Set TS = TSFactory.Item(Run_Fields("RN_CYCLE_ID").value)
'Set TSTestFactory = TS.TSTestFactory
'Set TSTest = TSTestFactory.Item(Run_Fields("RN_TEST_ID").Value)
TestLab_RunTestSet = True
Re: Pass global parameters between tests via Workflow.
I resolved this, please disregard.
Note... cannot use the RUN object.. it is not in scope for this function which triggers the run set event.