Functional testing samples for the Visual Studio IDE

HCL OneTest UI ships with some example code you can use in your own scripts. You can open these examples from within the sample project shipped with HCL OneTest UI. The sample project was created using the HCL OneTest UI tutorial. For reference, you can look at the script and other test assets while you do the tutorial, or after you complete the tutorial, if you want to compare the script and test assets to your files or actually play back the script.

The sample project contains the script, verification points, object map, and other files that are created when you complete the tutorial. The sample script is in the state it would be in at the end of the tutorial. The tutorial script is named "ClassicsSample."

Opening the sample project

To open the examples in the sample project, click File > Open > Project, browse to C:\Program Files\IBM\SDP\FunctionalTester\vsnet\FTSampleProject, and open FTSampleProject.rftvs. The project displays in the Solution Explorer. Double-click on the script name in the Solution Explorer to display the script in the Code Editor window. To play back the script, click the Run Functional Test Script button Run Functional Test Script on the product toolbar.

Examples

The project contains example code you can use in your own scripts.

Class Package Description
ExtensionScript superscript Provides several general utility methods.
HtmlScript superscript Provides a handler to automatically dismiss unexpected active HTML dialog boxes.

Using the examples

If you want to use the examples, copy the superscript directories and their contents into a Functional Test project.

To use one of the superscripts:

  1. Set the helper base class property for a script to the full class name of the superscript. For example, to use the ExtensionScript base class for a script called X, right-click on X in the Solution Explorer, and click Properties.

  2. In the X Property Pages dialog box, select Functional Test Script in the list on the left.

  3. In the Helper base class field, type superscript.ExtensionScript.

  4. Click OK.

You can modify your project preferences to extend the ExtensionScript superscript for all new scripts in the project. To do so, you must define a default helper base class for a project.

To modify project preferences:

  1. Right-click on the project and click Properties.

  2. In the HCL OneTest UI Project field, type New Script Helper base class.

  3. Click OK.

Now your X script can make use of the additional methods of ExtensionScript such as GetClipboardText(), SetClipboardText(), and ClipboardVP().