srini_g_vasan
11 years agoOccasional Contributor
how to use same mapping for different run time objects.
Team,
On clicking a menu in application , new form will appear in my application. Each form has instance column to map the form to other component in my application. on form load instance column is -1 , I can set that to 1,2,3 etc to match to any external component.
I have created name mapping with property instanceid as -1. for first form I get the mapping object and store it in a js variable. Now I change the instance of the form to external component instance= 2 . Now i click a menu again new form get appeared , to refresh the mapping I m calling RefreshMappingInfo()on alaises. Now namemapping is pointing to new form.
But js variable in which I had old form instance is also
mapped to new form...I understand this is because of reference change.
But I need both the instance .
Is there any way in testcomplete to resolve this requirement.
Regards,
Srini
On clicking a menu in application , new form will appear in my application. Each form has instance column to map the form to other component in my application. on form load instance column is -1 , I can set that to 1,2,3 etc to match to any external component.
I have created name mapping with property instanceid as -1. for first form I get the mapping object and store it in a js variable. Now I change the instance of the form to external component instance= 2 . Now i click a menu again new form get appeared , to refresh the mapping I m calling RefreshMappingInfo()on alaises. Now namemapping is pointing to new form.
But js variable in which I had old form instance is also
mapped to new form...I understand this is because of reference change.
But I need both the instance .
Is there any way in testcomplete to resolve this requirement.
Regards,
Srini
- I think Checkpoints could help you out a lot. There are Property Checkpoints which let you check for different properties available for an object or child object. This may be the simplest to use.
Then there are Region Checkpoints where you can capture an image, mask parts of it, compare the stored image with the newer image from playback etc. http://support.smartbear.com/viewarticle/57039/
Since it sounds like you are needing the comparison more using a property checkpoint or region checkpoint may be the simplest to either script or keyword.
If you use Keyword tests, you would get the object up to the point just before it changes, set the initial checkpoint, perform your next action which would change the form, then set the follow up checkpoint, then setup if statements after the initial checkpoint with the checkpoint as part of the requirements, have it perform the action, set another if statement with the follow up checkpoint as the requirement, then your next actions.
With script tests, I would functionalize the checkpoints have it return true or false, setup the initial checkpoint, setup an if statement with the checkpiont referencing the initial checkpoint, perform an action on true, exit program or loop on false, setup the follow up checkpoint, and repeat above.
Hope this helps.