18.3.5 测试DevComponents的hScrollBarAdv控件(2)
Configuration.xml文件的内容如下所示:
- <!-- Merge this XML content into file "<QuickTest Professional>dat SwfConfig.xml". -->
- <Control Type="DevComponents.DotNetBar.ScrollBar.HScrollBarAdv" MappedTo="SwfScrollBar">
- <CustomRecord>
- <Component>
- <Context>AUT</Context>
- <DllName>E: mpQuickTestCustomServer_vScrollBarAdv_hScrollBarAdvQuickTestCustomServer_vScrollBarAdv_hScrollBarAdvBinQuickTestCustomServer_vScrollBarAdv_hScrollBarAdv.dll</DllName>
- <TypeName>QuickTestCustomServer_vScrollBarAdv_hScrollBarAdv.ScrollBar</TypeName>
- </Component>
- </CustomRecord>
- <CustomReplay>
- <Component>
- <Context>AUT</Context>
- <DllName>E: mpQuickTestCustomServer_vScrollBarAdv_hScrollBarAdvQuickTestCustomServer_vScrollBarAdv_hScrollBarAdvBinQuickTestCustomServer_vScrollBarAdv_hScrollBarAdv.dll</DllName>
- <TypeName>QuickTestCustomServer_vScrollBarAdv_hScrollBarAdv.ScrollBar</TypeName>
- </Component>
- </CustomReplay>
- <!--<Settings>
- <Parameter Name="sample name">sample value</Parameter>
- </Settings> -->
- </Control>
在完成了对hScrollBarAdv控件的插件扩展开发并成功部署后,即可在QTP中录制出如下所示的控制hScrollBarAdv控件的脚本:
- SwfWindow("Form1").Activate
- SwfWindow("Form1").SwfScrollBar("hScrollBarAdv1").SetValue "44"
可见,对hScrollBarAdv控件的拖动可以通过设置精确的位置值来达到,而不是通过鼠标拖拽或者键盘操作,并且支持录制生成脚本。
http://book.51cto.com/art/201208/352942.htm