I am new to the tool, which is why the question will likely seem trivial.
I am creating a suite of tests for a web application. There are certain actions that are common to all the test (login sequence for example). I would like to create a script with utility methods that can be shared by all scripts in all the projects in the suite. Rather than repeat login sequence in each script of each project, I would like to be able to call SharedScript.Login method, possibly passing credentials into it.
When you create the script unit, save it to a common directory. Then, in your other project, right click on the Script node in the project tree, select "Add existing" and then browse to and "attach" your unit.
For example, we have a folder in our directory structure called Common. That folder has several sub folders for different sets of libraried code. We then, when we create a project, add the necessary libraries to our script project.
Thank you for your reply. What is the syntax for defining a common script (is the the same as other scripts) and what is the syntax of invoking the method on a script? I am used to OO programming where you have to instantiate an object before you can invoke methods on it. What is the rule here?
I do this all the time. It's really easy. Just as was said before, you save the script to common script folder at script creation. To call it (I use JScript), you simply include //USEUNIT TheScriptNameHere. To include it in any other project, just ensure that you add the script to the current project and use //USEUNIT TheScriptNameHere in the script that uses the methods and/or objects.