Configure UFT One to record mouse clicks

This task describes how to instruct UFT One to record right mouse clicks by modifying the configuration file manually.

Export the configuration file

  1. Select Record > Web Event Recording Configuration, and then click Custom Settings. For user interface details, see the section on the Custom Web Event Recording Configuration dialog box.

  2. Export your custom configuration to an .xml file by selecting File > Save Configuration As. Then, navigate to the folder in which you want to save the Web event recording configuration file, and enter a configuration file name. The extension for configuration files is .xml.

Back to top

Open the XML file in a text editor

Open the configuration file for editing in any text editor. The configuration file uses a predefined XML structure. For details, see Web Event Recording Configuration Dialog Box.

The following example illustrates the beginning of an exported configuration file:

The Property Name element controls the recording of the mouse buttons. The values of the mouse buttons are defined as follows:

  • 1. Left

  • 2. Right

  • 4. Middle

Back to top

Modify the XML file to enable mouse click recording

  1. Edit the .xml file as follows:

    • To record a left mouse click for the onmouseup event, add the following line:

      <Property Name="button" Value="1" Listen="2" Record="2"/>
    • To record right and left mouse clicks for the onmousedown event, add the following lines:

      <Event Name="onmousedown" Listen="2" Record="1">
      <Property Name="button" Value="2" Listen="2" Record="2"/>
      <Property Name="button" Value="1" Listen="2" Record="2"/>
      </Event>

    Note: Only one event, either onmouseup or onmousedown, should be used to handle mouse clicks. If both events are used, UFT One records two clicks instead of one. By default, UFT One listens for the onmouseup event.

  2. Save the .xml file.

Back to top

Load the XML file

  1. In the Custom Web Event Recording Configuration Dialog Box, select File > Load Configuration. The Open dialog box opens.

  2. Navigate to the folder in which you saved the edited configuration file, select the file, and click Open. The Custom Web Recording Configuration dialog box reopens.

  3. Click OK. The new configuration is loaded, with all preferences corresponding to those you defined in the .xml configuration file. Any Web objects you now record will be recorded according to these new settings.

Back to top