Ask a Question

Is there any way to createObject of the Unit

praveensqa
Contributor

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 3
Abramova
Staff

RE: Is there any way to createObject of the Unit

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.

I’m not a member of the SmartBear Support Team, I’m just helping users in this community. Any views or opinions expressed do not necessarily represent those of SmartBear Software.
praveensqa
Contributor

RE: Is there any way to createObject of the Unit



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

Abramova
Staff

RE: Is there any way to createObject of the Unit

Hi Praveen,


As Helen has already said in your other thread, you can use project or project suite variables. These variables will be available in any script unit of your project (project suite).

I’m not a member of the SmartBear Support Team, I’m just helping users in this community. Any views or opinions expressed do not necessarily represent those of SmartBear Software.
cancel
Showing results for 
Search instead for 
Did you mean: