Recording a Sample Test Case for the Component Explorer

Use the following procedure to become familiar with the sample Silk Test Classic Flex application, the Component Explorer.

To record a test case for the Component Explorer:

  1. Click Record Testcase on the Basic Workflow bar.
  2. In the Record Testcase dialog box, type the name of your test case into the Testcase name field. Test case names are case sensitive; they can have any length and consist of any combination of alphabetic characters, numerals, and underscore characters.
  3. From the Application State list box, select DefaultBaseState to have the built-in recovery system restore the default BaseState before the test case begins executing.
  4. Click Start Recording. Silk Test Classic closes the Record Testcase dialog box and displays the Flex sample application.
  5. When the Recording window opens, record the following scenario using the Flex sample application. It is essential that you perform these steps exactly as they are documented. Otherwise, your test case script may not match the sample provided later in this document.
  6. Click the image\ebx_575223517.gif arrow next to the Visual Components tree element to expand the list.
  7. Click the image\ebx_575223517.gif arrow next to the General Controls tree element to expand the list.
  8. Click the SimpleAlert tree element.
  9. In the Alert Control Example section, click Click Me near the top of the window and then click OK in the Hello World message box.
  10. Click the image\ebx_-1492220763.gif arrow next to the General Controls tree element to hide the list.
  11. Click the image\ebx_-1492220763.gif arrow next to the Visual Components tree element to hide the list.
  12. In the Recording window, click Stop. Silk Test Classic opens the Record Test Case dialog box, which contains the recorded script.
  13. Click Paste to Editor. The Update Files dialog box opens.
  14. Choose Paste test case and update window declaration(s) and then click OK.
Your test case should include the following calls:
WebBrowser.BrowserWindow.Application.CompLibTree.Open("Visual Components")
WebBrowser.BrowserWindow.Application.CompLibTree.Open("Visual Components>General Controls")
WebBrowser.BrowserWindow.Application.CompLibTree.Select("Visual Components>General Controls>SimpleAlert") 
WebBrowser.BrowserWindow.Application.Button1.Click()
WebBrowser.BrowserWindow.Application.Ok.Click()
WebBrowser.BrowserWindow.Application.CompLibTree.Close("Visual Components>General Controls")
WebBrowser.BrowserWindow.Application.CompLibTree.Close("Visual Components")

The Silk Test Classic Flex Automation SDK is based on the Automation API for Flex. The Silk Test Classic Automation SDK supports the same components in the same manner that the Automation API for Flex supports them. For instance, when an application is compiled with automation code and successive .swf files are loaded, a memory leak occurs and the application runs out of memory eventually. The Flex Component Explorer sample application is affected by this issue. The workaround is to not compile the application .swf files that Explorer loads with automation libraries. For example, compile only the Explorer main application with automation libraries. Another alternative is to use the module loader instead of swfloader. For more information about using the Flex Automation API, refer to the Apache Flex Release Notes.