I want to pass some variables between a Visual Test (VT) and either another VT or a Test Script (TS). I've done this in the past (previous version), but it seems that I'm either forgetting a step, which could be completely possible, or I've got it set up wrong. Couple of definitions and the specs on my version.
Parent VT: The VT that is executing.
Child VT: The VT that is instantiated by the Parent VT (or that is run within the Parent VT)
Child TS: The TS that is instantiated by the Parent VT (or that is run within the Parent VT)
TestPartner version 6.2.0 Build 448
Scenario 1: I'd like to pass a variable from a Parent VT to the Child VT. (I.E. I'd like to pass the child a varible so that it knows what version of IE it is testing against). I'm pretty sure that this is still functionality that doesn't exist for TestPartner. I've set this up to pass a variable from the Child VT to the Parent VT, but I'd like to go the other way. Can this be accomplished in this version of TestPartner?
Scenario 2: I'd like to pass a variable from a Child TS to the Parent VT. I've set up the variables in both the Parent VT and the Child TS. I've built the output relationship in the Child TS. I've assigned the Child TS variable to pass the contents into a local variable of the same type (Text, Number), but it isn't passing it through. I've placed a watch on the Child TS variables and they are correctly getting the values, but when the Child TS ends its execution the values aren't showing up in the Parent VT. Do I need to change the Playback settings on the playback of the Child TS? Is there something else I'm missing? Is this a known problem with this version of TestPartner?
You need to have the local variable in the child VT pass into a global variable. any other child VT or even the parent VT will then need to pull the global variable and assign it as a local variable within that VT. The variable will dissapear if you stop the test or if the test ends. I generally have it print out my variables first so I can get them again if needed.
I thought about using Global and that may be the way I need to go, but if I'm using a Global and am running several test scripts (automated) at the same time on different boxes that have different browser versions won't this fail at some time?
I was trying to build the Visual Tests so that they would figure out what version of the IE browser is installed and run the correct Attach version and be able to handle the different ways that IE6 and IE7 handle errors.
I may try the Global for short term knowing that it has some drawbacks.
Ok, I got it fixed. TP didn't like the fact that I had Dimmed the variables in the TS and then defined them as output. I guess it Dims them when you define them as input or output. I removed my Dim statements and it works fine.