Creating the First test script


Choose the File/New menu.
Choose the TestCase from the appearing list.
We got a new TestCase template filled with default data.

Select the TestCase node depicted by an ellipse in the top left "test script view" panel. In the bottom right panel appears the editor panel of the TestCase node.
Type the "basic stack test" into the "Title" field.
Type the "Testing the basic push&pop features of the tutorial.Stack class" into the "Comment" field.
Click on "Apply".

In the top left test script view panel select the InstanceCreator node depicted by a cogwheel. In the bottom right panel appears the editor panel of the InstanceCreator node.
Give a name to the instance in the "Instance Name" field:
Type the "tutorial." into the "Class" field. As soon as you typed the dot, a popup window will appear. You can choose the classes or subpackages of the typed package from this popup window. Choose the "tutorial.Stack" class.
Click the Constructor chooser button "...". A popup window appeas from which you can choose a constructor that will create your instance. Choose the "public tutorial.Stack()" constructor.
Click on "Apply".



In the top left test script view panel select the TestCall node depicted by a sheet. In the bottom right panel appears the editor panel of the TestCall node.
From the "Instance Name" combobox choose the "myStack" instance.
Give a name to this testcall in the "Title" field: "push into stack".
Choose the "tutorial.Stack" from "Class" combo.
Click the Function chooser button "...". A popup window appears from which you can choose a function that you want to test. Choose the "public void push(java.lang.Object)" function.
Click on "Apply".



Expand the Testcall node depicted by a sheet in the top left test script view and appears "Parameters" node in this script view.
Select the parameter node named "P1".
In the top right panel choose the "java.lang.String" from the Type combobox.
In the bottom right panel appears the editor panel of the String type.
Give a value for the parameter of the push function in the Value field: "MyValue".
Click on "Apply".



Select the TestCase depicted by ellipse in the top left test script view panel.
In the bottom left "palette" panel double click on the TestCall.
Now a new testcall is added to our TestCase.
Choose this new TestCall and fill it's fields:
InstanceName: myStack
Title: pop from stack
Class: tutorial.Stack
Function: pop()
Click on "Apply".




Our first test script is ready. Let's save and try it!
Choose the File/Save menu. Choose the directory: "tutorial\script", and give the file name: "mystacktest.xml", and click Save
Choose the File/Run menu.
We got a "Script has finished successfully" message, and a popup window that contains the return values of our test.
You can see the "pop from stack" TestCall returned with the "MyValue" value as we expected.