Step Into, Out of, or Over a specific step - Exercise

Relevant for: GUI actions, scripted GUI components, and function libraries

In this exercise, you create a sample function library and run it using the Step Into, Step Out, and Step Over commands.

Note: For a task related to this exercise, see Debug a test, component, function library, or user code file.

Create the sample function library and test

  1. Select File > New > Function Library to open a new function library.

  2. In the function library, enter the following lines exactly:

    public Function myfunc()
    msgbox "one"
    msgbox "two"
    msgbox "three"

    The End Function is automatically added by UFT One.

  3. Save the function library to your ALM project or to the file system, with the name SampleFL.qfl.

  4. Select File > New > Test and select GUI Test to open a new test.

  5. Click the document tab for the SampleFL.qfl function library to bring it into focus.

  6. Right-click the function library document tab and select Associate Library 'SampleFL.qfl' with 'Test' to associate the function library with your test.

  7. Click the document tab for the action you created to bring it into focus. Click the Editor/Keyword View toggle button to display the Editor and enter the following lines exactly:

    myfunc
    myfunc
    myfunc 
    endOfTest="true" 

Back to top

Run the function library and use the commands

  1. Select the first step of the action (the first call to the myfunc function) and add a breakpoint by pressing F9 (Insert/Remove Breakpoint). The breakpoint symbol is displayed in the left margin .

  2. Run the test. The test pauses at the breakpoint.

  3. Press F11 (Step Into). The execution arrow points to the first line (msgbox "one") of the function in the function library.

  4. Press F11 (Step Into) again. A message box displays the text one.

  5. Click OK to close the message box. The execution arrow moves to the next line in the function.

  6. Continue pressing F11 (Step Into) (and pressing OK on the message boxes that open) until the execution arrow leaves the function and is pointing to the second step in the action (the second call to the myfunc function).

  7. Press F11 (Step Into) to enter the function again. The execution arrow points to the first msgbox line within the function.

  8. Press SHIFT+F11 (Step Out). Close each of the message boxes that opens. Notice that the execution arrow continues to point to the first line in the function until you close the last of the three message boxes. After you close the third message box, the execution arrow points to the next line in the action (the third call to the myfunc function).

  9. Press F10 (Step Over). The three message boxes open again—this time, in the Keyword View. The execution arrow remains on the same step in the action until you close the last of the three message boxes. After you close the third message box, the execution arrow points to the next step in the action.

Back to top