Forum Discussion

praveensqa's avatar
praveensqa
Contributor
13 years ago

Is there any way to createObject of the Unit

Hi All,



Is there any way to createObject of the Unit. 

If that is there i will call the methods and Variables of that unitObject. 



Please suggest any Good Book for TestComplete. I will go through, when i will get these type of questions get. 



Regards,

Praveen

 

3 Replies

  • Hi,




    Is there any way to createObject of the Unit.

    If that is there i will call the methods and Variables of that unitObject.


    I'm afraid that I don't quite understand what you're going to do. If you need to manage script units included in the project, you can use the methods and properties of the ProjectIntegration object. For example, to create a new script unit to the project programmatically, you can use the ProjectIntegration.AddUnit method.


    Could you please clarify what you're trying to do?  Perhaps there's another way to achieve the same result.




    Please suggest any Good Book for TestComplete. I will go through, when i will get these type of questions get.


    You can read the following books:


    TestComplete 8 Made Easier - Keyword Testing

    TestComplete 8 Made Easier - Scripting


    Also, you can find answers to your questions in TestComplete's Online Help.



  • Hi Margaret Abramova,






    I want to access all the variables of the Sub/Functions of one unit to another Unit. 






    Unit is Te2


    'USEUNIT Te3   






    Sub pro 


       dim va 


      


       Va=10 


       


     End Sub






    Unit is Te3


    'USEUNIT Te2 






    Function Te3 


      Te2.pro// for calling Te2 Pro--- Fine. 


         \\ Here i need to get the Va variable value from unit Te2


          if i type Te2.Va--- Ok, but while execute the test i am getting object doesn't support the Exception is coming.






        How i will get Va value in this unit. is there any method? 










      End Function 






    Helen Kosova given one solution in my previous thread(Access Global Variables).


    Suppose if i have Object of that Unit, using that i object i can access those variable like Object(Te2).Va. That is the reason i posted this thread.






    Regards,


    Praveen