|
今天忙,没空多写了。贴一段help里的文字先。
Tips for Working with Event Listening and Recording
It can sometimes be difficult to find the ideal listen and recording settings. When defining these settings, keep in mind the following guidelines:
If settings for different objects in the Objects Pane conflict, QuickTest gives first priority to settings for specific HTML Tag Objects and second priority to Web Objects settings. QuickTest only applies the settings for Any Web Object to Web objects that were not defined in the HTML Tag Object or Web Objects areas.
To record an event on an object, you must instruct QuickTest to listen for the event, and to record the event when it occurs. You can listen for an event on a child object, even if a parent object contains the handler or behavior, or you can listen for an event on a parent object, even if the child object contains the handler or behavior.
However, you must enable recording for the event on the source object (the one on which the event actually occurs, regardless of which parent object contains the handler or behavior).
For example, suppose a table cell with an onmouseover event handler contains two images. When a user touches either of the images with the mouse pointer, the event also bubbles up to the cell, and the bubbling includes information on which image was actually touched. You can record this mouseover event by:
Setting Listen on the <TD> tag mouseover event to If Handler (so that QuickTest "hears" the event when it occurs), while disabling recording on it, and then setting Listen on the <IMG> tag mouseover event to Never, while setting Record on the <IMG> tag to Enable (to record the mouseover event on the image after it is listened to at the <TD> level).
Setting Listen on the <IMG> tag mouseover event to Always (to listen for the mouseover event even though the image tag does not contain a behavior or handler), and setting Record on the <IMG> tag to Enabled (to record the mouseover event on the image).
Instructing QuickTest to listen for many events on many objects may lower performance, so try to limit listening settings to the required objects.
In rare situations, listening to the object on which the event occurs (the source object) can interfere with the event.
If you find that your application works properly until you begin recording on the application using QuickTest, your listen settings may be interfering.
If this problem occurs with a mouse event, try selecting the appropriate Use standard Windows mouse events option(s) in the Advanced Web Options dialog box. For more information, see Advanced Web Options.
If this problem occurs with a keyboard or internal event, or the Use standard Windows mouse events option does not solve your problem, set the listen settings for the event to Never on the source object (but keep the record setting enabled on the source object), and set the listen settings to Always for a parent object. |
|