Recording a Script

Use Silk Test Workbench to record the actions performed when testing applications. When an action is performed, the action, and the responses of the application worked with, are recorded as commands in a script.

During recording, Silk Test Workbench records all interactions with the test application (except interaction with Silk Test Workbench itself) until recording is stopped. After you have finished recording, you can modify the script you have generated to add and remove steps.

  1. Choose File > New.
    The New Asset dialog box opens.
  2. Select .NET Script from the asset types list, and then type a name for the script in the Asset name text box.
    Note: The script is created in the Common project by default, but you can create it in another project by selecting it from the Project list.
    When using Silk Test Workbench with an Oracle database, all saved script names are case sensitive. Which means that a script named SCRIPT1 can coexist in the same Oracle database with a script named Script1 and not be considered a duplicate. However, when using Silk Test Workbench with either SQL Server or Access, saved scripts are not case sensitive.
  3. Optional: Click Options if you want to change Silk Test Workbench record options.
  4. Check the Begin Recording check box to start recording immediately.
  5. Click OK to save the script as an asset and begin recording.
    If you click OK without checking the Begin Recording check box, Silk Test Workbench saves the script as an asset and displays the script template. The Select Application dialog box opens.
  6. If you have not set an application configuration for the current project, select the tab that corresponds to the type of application that you are testing:
    • If you are testing a standard application that does not run in a browser, select the Windows tab.
    • If you are testing a web application or a mobile web application, select the Web tab.
    • If you are testing a native mobile application, select the Mobile tab.
  7. To test a standard application, if you have not set an application configuration for the current project, select the application from the list.
  8. To test a web application or a mobile web application, select one of the installed browsers or mobile browsers from the list.
    1. Specify the web page to open in the Enter URL to navigate text box. If an instance of the selected browser is already running, you can click Use URL from running browser to record against the URL currently displayed in the running browser instance.
    2. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
      For example, to test a web application on Apple Safari and in a browser window which is as big as the screen of the Apple iPhone 7, select Apple iPhone 7 from the list.
    3. Optional: Select an Orientation for the browser window.
    4. Optional: Click Edit Browser Sizes to specify a new browser size and to select which browser sizes should be shown in the Browser size list.
  9. To test a native mobile application (app):
    1. Select the mobile device, on which you want to test the app, from the list.
    2. Select the native mobile application.
      • If you want to install the app on the mobile device or emulator, click Browse to select the app file or enter the full path to the app file into the App file text field. Silk Test Workbench supports HTTP and UNC formats for the path.
      • If you want to use an app that is already installed on an Android device, select the app from the Package/Activity list or specify the package and the activity in the Package/Activity field.
      • If you want to use an app that is already installed on an iOS device, specify the Bundle ID.
      • If you want to use an app that is available in Mobile Center, specify the App identifier.
  10. Click OK.
    Silk Test Workbench minimizes and the application and the Recording window opens.
  11. Record the actions that you want to test. During recording the Silk Test Workbench icon on the task bar flashes. For information about the actions available during recording, see Actions Available During Recording.
  12. If you are recording against a web application on one of the supported browsers, and you want to interact with a control that you cannot access directly in the UI, for example because the control is hidden by another control, click Toggle Hierarchy View in the Recording window and select the control from the control hierarchy tree. This functionality is available if you are testing against one of the following browsers:
    • Microsoft Edge.
    • Apple Safari.
    • Mozilla Firefox 41 or later.
    • Google Chrome 50 or later.
    • A mobile browser.
  13. Optional: Add verification logic to the test.
    • If you are testing a standard or web application, click Ctrl+Alt to add verification logic to the test. Silk Test Workbench temporarily suspends recording and displays the Test Logic Designer wizard.

      Follow the wizard through the process and click Finish to close the wizard and continue recording.

    • If you are testing a web application on Microsoft Edge or a mobile application, click on the object that you want to verify and click Add Verification in the Choose Action dialog box.
    For additional information about adding a verification, see Adding a Verification to a Script while Recording.
  14. Stop recording by pressing Alt+F10, clicking Stop in the Recording window, or clicking the Silk Test Workbench taskbar icon.
    The Recording Complete dialog box opens. If the Do not show this message again check box is checked in the Recording Complete dialog box, this dialog box does not appear after recording is stopped. In this case, the script displays.
  15. Perform one of the following steps:
    • Click Playback to close the Recording Complete dialog box and save the script.

      The Playback dialog box opens, which allows you to specify result information and playback the script.

    • Click Go to .NET Script to open the script in the Code window.
    • Click Save to save the script and exit the Recording Complete dialog box.

      The script appears in the Code window.

    When the recorded test displays in the Code window, you can play it back at any time.