Select the File -> New menu from the menu bar. (or) select from the �white icon� in the left top corner of the window.
It will ask for various kind of files to open. Select the �4Test include file� to declare the window objects from the application.
The �4Test Script file� option is to open the script file where we will be writing testscript.
The above two files are more important for building the scripts.
Open the application you want to test. If you are going to test the Yahoo site, then open the browser load the page you want to start testing.
The page that you start testing the application will be assumed as the �BaseState�. Even we can explicitly declare the window base state.
The Test Script file will be used only after creating the include file. We will be using the include file to write the script file. Hence we have to declare the include file that we are calling in the testscript files.
To open an existing file, select File -> Open and select the existing file.
To write a new plug & play testcase (using Action)
This example is to write the script for logging into the yahoo site.
Start the Silk Test by selecting from the �Start� menu.
Configure the settings as given in lab I.
Click �File -> New �menu, and select the �4Test script file� option.
Click on the OK button.
Start with the keyword �testcase Action ()� and press Enter key in your keyboard. The testcase is the default keyword for any testcase and the name Action is the name of the testcase. The testcase name can be anything but it is advisable to name it clearly so that will represent the functionality of the test.
Now start writing the testcase (Follow the below instructions)
Open the application in parallel ie., open the browser in which the application has to run. (say Netscape)
Go to Silk Test
Click Record -> Actions. Menu from the menu bar.
It will load the �Record Actions� dialog box.
Keep the dialog box as it is, go to the application and do the action what ever you want to perform.
The silktest will record the events you do sequentially and you can vie it in the �Record Actions� dialog.
After completing your task (till whatever you want to record), click on the �paste to editor� button in the �Record Action� dialog box.
Then click the close button to close the Record actions dialog box and go to your application.
Now the recorded code will be readily available in the testscript editor, inside the testcase.
Now delete the keyword �recording� in your first line of the recorded code.
Now, select the entire recorded code by keeping the mouse arrow at the leftmost dot (.) in your editor at the first line, and drag it till the end.
Right click on the selected code and select the �Move Left� option.
The code is ready now.
Now, compile the code from the �Run -> compile� option and run the script by selecting the �Run -> Run� menu.
Now the testcase will automatically start the application and perform the events recorded and throws the results.
The sample recorded testcase for yahoo login look like this :
Testcase Action ()
// [-] recording
Browserpage.Set Active ()
Browser.Location.Set Text (www.yahoo.com�)
Browser.Location. Type Keys (��)
Yahoo.HtmlLink (�Mail| #26|$http:??www.yahoo.com?r?m2�).Click ()
BrowserPage.HtmlTextField(�Yahoo!ID: | # 1�). SetPosition (1, 1)
BrowserPage.HtmlTextField(�Yahoo!ID: | # 1�). Set Text (�username�)
BrowserPage.HtmlTextField(�Yahoo!ID: | # 1�). TypeKeys (���)
BrowserPage.HtmlTextField(�Password:|#2�).Set Text (�password�)
BrowserPage.HtmlPushButton (�Sign In|#1�). Click ()
The 4 Test language
The 4 Test language is an object-oriented fourth-generation language (4GL) designed specifically with the needs of the QA professional in mind. 4 Test�s powerful features are organized into three basic kinds of functionality:
A robust library of object-oriented classes and methods that specify how a testcase can interact with an application�s GUI objects.
A set of statements, operators, and data types that you use to add structure and logic to a recorded testcase.
A library of built-in functions for performing common support tasks. Note This section provides a high-level look at 4 Test.