Forum Discussion

steven_price8's avatar
steven_price8
Occasional Contributor
12 years ago

Calling scripts within scripts

Hello,

just a quick question,

I am very new to testComplete.

is it possible to call another script from within one script?

I'm hoping i can break up large test cases into smaller test cases,

So if there is any changes on the web pages under test I only need to change the required called script.

Also can anyone tell me how the scripts are stored?

Is there a repository of script?

Are they version controlled?

Any help is appreciated.

Thanks

Steve

2 Replies

  • hi,

    Use 'Runner' objects CallMethod.

    Help



    Method calls a script routine specified by its name and unit name

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Steven, yes you can call between Scripts by adding references to scripts using USEUNIT, the preferred method is as per the documentation here.




    I would not recommend using Runner::CallMethod() because as per the documentation, this method is obsolete and it is supported for backward compatibility only.


     


    Scripts are stored as plain text files with Test Complete offering Source control integration as described here but I prefer to manage mine manually using Tortoise SVN.

     


    One thing to note is that the folder structure you create in Test Complete is virtual, if you want to store scripts in different folders on disk you have to manually create them and make sure you save Script Units to the correct folder when you create them, otherwise Test Complete will save all Script Units in the default location.


     


    Regards


    Phil Baird