Absent Member.. vzamoraz Absent Member..
Absent Member..

QTP/UFT tip: What to do if when replay test a pop-up window appears randomly on the test.

There are some cases where a script is recorded however the application randomly shows pop-up messages depending on random details of the functionality.


How handle if a random pop-up appears.

  1. Go to Resources > Recovery Scenario Manager.
  2. By default, the Recovery Scenario Manager dialog box opens with a new recovery file. You can either use this new file, or click <Open> to choose an existing recovery file.
  3. Click the "New Scenario" button. This is the first button on the Scenario toolbar. The Recovery Scenario Wizard will open.
  4. Click <Next>.
  5. Select the "Pop-up window" radio button.
  6. Click <Next>.
  7. Click the Hand button.
  8. Point to and click on the pop-up window.
  9. If you want to identify the window using its title, select the "Window title" checkbox.
  10. Verify the captured title. If you modify the value to contain a regular expression, select the "Regular expression" checkbox.
  11. If you want to identify the window using its text, select the "Window text contains" checkbox.
  12. Verify and modify, if desired, the captured window text. If you use regular expressions, select the "Regular expression" checkbox.
  13. Click <Next>.
  14. Click <Next> to define a recovery operation.
  15. Select a recovery operation.
  16. Click <Next>.

    If you selected "Keyboard or mouse operation," continue with step 17.
    If you selected "Close application process," continue with step 19.
    If you selected "Function call," continue with step 21.
    If you selected "Restart Microsoft Windows," continue with step 24.
  17. Specify the keyboard or mouse operation that you want QuickTest to perform when it detects the trigger event.
  18. Click <Next>. Continue with step 24.
  19. Select the process or processes to be ended. To add a process from the Running processes list, double-click a process in the Running processes list or select it and click <Add>.

    Note: You can select multiple processes using standard Windows multiple selection techniques (CTRL and SHIFT keys).
  20. Click <Next>. Continue with step 24.
  21. Select the file containing your library functions.
  22. Select a function option. To use an existing function, select the "Select function" radio button.

    Note: Only functions that match the prototype syntax for the trigger type selected in the Select Trigger Event Screen are displayed. For pop-up windows, use the following prototype syntax:

    Function <function name>(Object)
       ' recovery information and code goes here
    End Function

    ' Close the About Notepad window.
    Function AboutWindow(Object)
    End Function

    To use a new function, select the "Define new function" radio button. Create a new function by specifying a unique name for it, and defining the function in the Function Name box according to the displayed function prototype. The new function is added to the library file you selected.
  23. Click <Next>. Continue with step 24.
  24. After you have defined at least one recovery operation, the "Add another recovery operation" checkbox is displayed.

    If you want to define another recovery operation, click <Next>. Continue with step 15.
    If you are done defining recovery operations, clear the checkbox, then click <Next>.
  25. Select a post-recovery option.
  26. Click <Next>.
  27. Enter a name for the recovery scenario.
  28. Enter a description for the recovery scenario.
  29. Click <Next>.
  30. To associate the newly defined recovery scenario with the current test, select the "Add scenario to current test" checkbox. To associate the recovery scenario with all new tests, select the "Add scenario to default test settings" checkbox.
  31. Click <Finish>.


Labels (1)
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.