恢复QTP默认设置•菜单:Tools|Options•General选项卡•RestoreLayout•查看帮助设置运行方式•菜单:Tools|Options•Run选项卡•Runmode•Viewresultswhenrunsessionends•AllowotherMercuryproductstoruntestsandcomponents(测试管理工具QC)•Savemovietoresults•查看帮助QTP的对象库(ObjectRepository)在QTP中如何识别对象如何在对象库中查找对象,添加对象使用关键字视图(KeywordView)改变对象的逻辑名(logicalname)对象类型ObjectTypesQTP是一个界面测试工具按钮下拉列表框文本框单选按钮如何识别一个对象QTP识别对象对象库对象库中保存QTP录制时操作的对象的部分属性,这些属性可以帮助识别相应的对象菜单:Resources|ObjectRepository,打开对象库对象查看器ObjectSpyAtoolusedtodetermineobjectpropertiesandvaluesofanobject菜单Tools|ObjectSpy对象库中增加对象和删除对象对象的附加文本属性菜单Tools|OptionsWindowsApplications选项卡“附加文本”搜索参数设置搜索半径搜索圆心TestObjectvsRun-timeObjectAtestobjectisanobjectthatQuickTestcreatesinthetesttorepresenttheactualobjectinyourapplication.QuickTeststoresinformationontheobjectthatwillhelpitidentifyandchecktheobjectduringtherunsession.Arun-timeobjectistheactualobjectinyourapplicationonwhichmethodsareperformedduringtherunsession.Youcanmanipulatetestobjectandrun-timeobjectbyusingthefollowingmethods:GetTOPropertySetTOPropertyGetROPropertyGetTOProperties方法在帮助文档查找GetTOProperties方法的使用指南DimtpDialog(Login).WinEdit(AgentName:).Setmercurytp=Dialog(Login).WinEdit(AgentName:).GetTOProperties(attachedtext)msgboxtpQTP的同步点SynchronizationWhatobjectinthisapplicationtakeslongertoprocessthantherestoftheobjects?SomeVisualCueExamples可以作为同步点的地方Aprogressbarreaches100%completion.进度条到达100%处Astatusmessageappears.状态信息出现Abuttonbecomesenabled.按钮可用Awindowopensreadydataentry.输入数据的窗口出现Apop-upmessageappearsinresponsetoanoperation.响应操作的弹出消息出现插入同步点录制脚本时可用插入同步点10000毫秒=10秒ObjectSynchronizationtimeoutGlobalSynchronizationtimeoutvaluewaitsforeachobjectwiththesameamountoftime全局同步时延菜单:File|Settings等待时间=全局同步时延+同步点时延同步点内部算法Forexample,thefollowingstatementsinstructQuickTesttowaitupto20secondsfortheFlightsTabledialogboxtoopen.blnDone=Window(FlightReservation).Dialog(FlightsTable).Existcounter=1WhileNotblnDoneWait(2)blnDone=Window(FlightReservation).Dialog(FlightsTable).Existcounter=counter+1Ifcounter=10thenblnDone=TrueEndifWendMercuryQuickTestProfessionalUser'sGuideCreatingTestsAddingStepsContainingProgrammingLogicSynchronizingYourTestAddingExistandWaitStatements同步点内部算法参数化录制实验程序使用DataTable进行参数化RandomNumber环境变量的使用DataDriver录制实验程序只录制预定机票的流程对预定机票中的数据进行参数化使用DataTable进行参数化对FlyFrom和FlyTo进行参数化回放发现问题,如何解决?RandomNumber航班列表采用随机数环境变量的使用菜单:File-Setting–UserDefined用环境变量来参数化DataDriverDataDriver功能可以自动检测脚本中可能需要进行参数化的变量菜单:Tools-DataDriver