|
楼主主要说的是winform程序
自动化过程中需要比对才能知晓控件等是否是预期的,所以需要在录制时得到它的某些属性,在回放时比对。一般Control ID是不会变化的。
LZ说的比较全了,如果没有插件QTP只能识别控件低层次的行为,而不是有意义的行为,尤其对于定制的控件来说,可能测试对象的方法不足。下面引用.net扩展帮助里的几段话:
If you are not satisfied with the existing object identification or behavior, your .NET Windows Forms control is a candidate for .NET Add-in Extensibility, as illustrated in the following situations:
➤ A test object class already exists with more appropriate behavior for your custom .NET Windows Forms control. You can use .NET Add-in Extensibility to map the control to this test object class.
➤ QuickTest might recognize the control using a test object that does not fit your needs. You can use .NET Add-in Extensibility to instruct QuickTest to change the functionality of the test object by modifying its methods.
➤ QuickTest might identify individual sub-controls within your custom control, but not properly identify your main control. For example, if your main custom control is a digital clock with edit boxes containing the hour and minute digits, you might want changes in the time to be recognized as SetTime operations on the clock control and not as Set operations on the edit boxes. You can use .NET Add-in Extensibility to set a message filter to process messages from child controls, and record operations on the main control in response to events that occur on the controls it contains.
Java扩展:
If you are not satisfied with the existing object identification or behavior, your control is a candidate for Java Add-in Extensibility, as illustrated in the following situations:
➤ QuickTest might recognize the control using a test object class that does not fit your needs. You can use Java Add-in Extensibility to map the custom class to another existing test object class or to a new test object class that you create.
➤ The test object class mapped to the control might be satisfactory, but you would like to customize the behavior of certain test object methods or identification properties. You can use Java Add-in Extensibility to override the default implementation of these properties and methods with your own
custom implementation.
➤ You may find that the test object names QuickTest generates for all controls of a certain Java class are identical (except for a unique counter) or that the name used for the control does not clearly indicate the object it represents. You can use Java Add-in Extensibility to modify how QuickTest names test objects for that Java class.
➤ QuickTest may identify individual sub-controls within your custom control, but not properly identify your main control. For example, if your main custom control is a digital clock with edit boxes containing the hour and minute digits, you might want changes in the time to be recognized as
SetTime operations on the clock control and not as Set operations on the edit boxes. You can use Java Add-in Extensibility to treat a custom control as a wrapper object for the controls it contains. QuickTest does not learn the individual controls contained in a wrapper object.
➤ During a record session, when you perform operations or trigger events on your control, QuickTest may not record a step at all, or it may record steps that are not specific to the control’s behavior. Alternatively, QuickTest may record many steps for an event that should be considered a single operation, or it may record a step when no step should be recorded. You can use Java Add-in Extensibility to modify the events to listen for and the test steps to record for specific events.
Web扩展
If you are not satisfied with the existing object identification or behavior, your Web control is a candidate for Web Add-in Extensibility, as illustrated in the following situations:
➤ QuickTest might recognize the control using a test object class that does not fit your needs. You can use Web Add-in Extensibility to instruct QuickTest to identify the custom control as belonging to a new test object class that you create.
➤ The test object class that QuickTest uses for the control might be satisfactory, but you would like to customize the behavior of certain test object methods or identification properties. You can use Web Add-in Extensibility to create a new test object class that extends the one QuickTest uses, override the implementation of these properties and methods with your own custom implementation, and instruct QuickTest to use the new test object class.
➤ You might find that the test object names QuickTest generates for all objects of a certain control type are identical (except for a unique counter) or that the name used for the test object does not clearly indicate the control it represents. You can use Web Add-in Extensibility to create a new test object class that extends the one QuickTest uses, modify how QuickTest names test objects of your new class, and instruct QuickTest to use the new test object class.
➤ QuickTest might identify individual sub-controls within your custom control, but not properly identify your main control. For example, if your main custom control is a digital clock with edit boxes containing the hour and minute digits, you might want changes in the time to be recognized as
SetTime operations on the clock control and not as Set operations on the edit boxes. You can use Web Add-in Extensibility to modify how events that occur on child controls are treated.
➤ During a record session, when you perform operations or trigger events on your control, QuickTest might not record a step at all, or it might record steps that are not specific to the control’s behavior. Alternatively, QuickTest might record many steps for an event that should be considered a single operation, or it might record a step when no step should be recorded.
[ 本帖最后由 shanxi 于 2009-3-12 09:54 编辑 ] |
|