It did not work either by using the Project/persistent variables as my requirement is to capture all the objects in programming units which are separated by the screens i.e. a programming unit for a screen having all of its objects.
Somehow i trued using the Arrays and then equating the same to the respective functions which i call in other programmig units and collect the objects to perform an action on those objects.Doing this allows me to have an easy maintenance of the scripts in case if there are any changes in the objects names/properties. It worked quite well but i am stuck on another situation in which i will have to create as many different functions as many new windows/screens or even dialogue boxes are there.
To make it easy to understand (if its confusing :)) below is my plan:
i have programming units like --Objecs_login (this holds all the objects on the login screen like
Function Login()
LoginBtn=Sys.Process("App")......
Dim arr_o
Arr(0)=LoginBtn
Login=arr_o
End Function )and then i have another unit like Object_Main_screen (this holds objects present on the main screen after userlogs in like function MainScreen()
DrpdnApp=Sys.Process("Java").Login("blabla").Panel("blabla").....
Dim arr_p
Arr_p(0)=DrpdnApp
MainScreen=arr_p
End Function)
Now i am using a progg unit as Action_Library having functions like :
Function Logging_in()
Dim a_arr_o
set a_arr_o==object_login.Login
call a_arr_o(0).keys("user")
End Function
or
Function Click_app()
Dim a_arr_p
set a_arr_p==object_login.MainScreen
call a_arr_p(0).Click("App")
End Function
-------------------------------------
My problem is Can i combine my functions where i am declaring the objects (addresses) ? Because when i do this, test complete tries to search the objects which are not present right now for ex. if i define all the objects of login screen and main screen in the same function then test complete throws an error saying it could not find the objects which are actually from Main screen which is true as thise objects are not present in screen yet. It does not even try to login to the application for which the objects are available and doing so can make those objects (of main screen) present too which is being searched by Test complete. I have used the multiple functions just to overcome this issue otherwise i wanted to usea single programming unit or function specifically dedictaed to the objects so that it can be maintained well in the future in the event of changes in the application.
Can you please suggest some solution if i was able to convey this simple but comlex puzzle ??
Thanks
yogesh