Creating Scripts

Silk Test Workbench uses scripts in the same manner as visual tests to mimic the actions that are performed while testing an application. It controls an application or Web page in the same way that a user would by using keystrokes and mouse actions to select menus, list items, and buttons. During recording, Silk Test Workbench generates all of the keystrokes and mouse clicks that test the application.

Silk Test Workbench's scripting language is Microsoft's Visual Basic, a robust programming language that gives you total control over any application running in the Microsoft .NET framework. .NET scripts contain the functionality of a high-level programming language as well as features designed specifically for software control and testing. Using the language, you can develop scripts that:
  • Run automatically at a specified time of day.
  • Run entirely unattended.
  • Interact with users to receive confidential information such as IDs and passwords.

The actions taken to test an application, making menu selections, typing data, checking the way it is processed, and so on, are represented in scripts as VB.NET commands. These commands are inserted into a script and can be modified and played back.

Silk Test Workbench lets you quickly record and playback scripts. Modify scripts to include “hand-coded” statements that cannot be recorded, to make amendments to reflect changes in the test application, or to create new scripts by cutting and pasting code from existing scripts. You can also use the Identify Object dialog box to record locators or object map items for individual objects and then use the locator or object map item in a script.

Recording is the best way to quickly create scripts. Recording enables you to become familiar with how Silk Test Workbench generates code for scripts. This provides familiarity with the basics of script creation, which then allows better understanding of creating efficient test solutions, modularizing scripts, and creating independent code modules.