您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > QTP测试实验报告-飞机票订票系统
QTP自动化功能测试实践一、实验目的1、熟悉QTP自动化功能测试流程2、能够利用QTP进行B/S或者C/S架构程序的自动化功能测试二、实验内容功能测试是针对应用系统进行测试,是基于产品功能说明书,是在已知产品所应具有的功能,从用户角度来进行功能验证,以确认每个功能是否都能正常使用。本项目主要使用QuickTest对其自带的MercuryTours网站/飞机票订票系统进行功能测试,要求录制预订机票的完整过程,然后执行测试脚本并分析结果。三、实验要求1、独立完成;2、提交测试脚本3、提交测试用例说明书及缺陷报告。四实验内容1脚本的录制与回放测试及检查点的设置验证脚本代码:Dialog(Login).WinEdit(AgentName:).CheckCheckPoint(AgentName:)'验证乘客名字文本框中的值标准检查点Dialog(Login).WinEdit(AgentName:).Set123456'输入用户名Dialog(Login).WinEdit(Password:).Setmercury'输入密码Dialog(Login).WinButton(OK).Click'单击OK按钮登陆Window(FlightReservation).Static(Static).CheckCheckPoint(Static)'检查页面中的图片元素是否加载Window(FlightReservation).ActiveX(MaskEdBox).Type011218Window(FlightReservation).WinComboBox(FlyFrom:).SelectLondonWindow(FlightReservation).WinComboBox(FlyTo:).SelectParisWindow(FlightReservation).WinButton(FLIGHT).ClickWindow(FlightReservation).Dialog(FlightsTable).WinList(From).Select12534LON08:00AMPAR10:00AMAF$165.50Window(FlightReservation).Dialog(FlightsTable).WinButton(OK).ClickWindow(FlightReservation).WinEdit(Name:).SetgccWindow(FlightReservation).WinEdit(Tickets:).SetSelection0,1Window(FlightReservation).WinEdit(Tickets:).Set5Window(FlightReservation).WinRadioButton(Business).SetWindow(FlightReservation).WinButton(InsertOrder).ClickWindow(FlightReservation).Close'关闭订票系统结果2参数化脚本测试本案例中将FlightFrom的选项内容设置为参数化类型脚本代码WithDialog(Login).WinEdit(AgentName:).Setaaaa.WinEdit(Password:).Setmercury.WinButton(OK).ClickEndWithWithWindow(FlightReservation).ActiveX(MaskEdBox).Type011218.WinComboBox(FlyFrom:).SelectDataTable(from,dtGlobalSheet)‘参数化.WinComboBox(FlyTo:).SelectSydney.WinButton(FLIGHT).ClickWith.Dialog(FlightsTable).WinList(From).Select12463LON03:07PMSYD04:48PMNW$160.40.WinButton(OK).ClickEndWith.WinEdit(Name:).Setgcc.WinEdit(Tickets:).Set3.WinRadioButton(Business).Set.WinButton(InsertOrder).Click.CloseEndWithwait(1)‘必须有wait函数回调给第二次循环预留准备时间结果脚本录制关键字视图脚本回放结果本案例中对Flight系统的用户登陆界面进行参数化的黑盒测试用到6组测试数据Username(用户登录)Password(登录密码)描述为空“mercury”用户名为空,密码正确“aaa”“mercury”用户名少于4个字符,密码正确“aaaa”“mercury”用户名,密码都正确“aaaa”为空用户名正确,密码为空“aaaa”“mercu”用户名正确,密码错误“aaaa”“mer”用户名正确,密码少于4个字符测试脚本Dialog(Login).WinEdit(AgentName:).SetDataTable(username,dtGlobalSheet)'输入用户名Dialog(Login).WinEdit(Password:).SetDataTable(password,dtGlobalSheet)'输入密码Dialog(Login).WinButton(OK).Click'点击登陆IfDialog(Login).Dialog(FlightReservations).ExistThenDialog(Login).Dialog(FlightReservations).WinButton(确定).Click'弹出提示框点击确认按钮Dialog(Login).Closeelse'登陆成功进入订票Window(FlightReservation).ActiveX(MaskEdBox).Type011218Window(FlightReservation).WinComboBox(FlyFrom:).SelectLondonWindow(FlightReservation).WinComboBox(FlyTo:).SelectParisWindow(FlightReservation).WinButton(FLIGHT).ClickWindow(FlightReservation).Dialog(FlightsTable).WinList(From).Select12274LON01:27PMPAR03:07PMNW$155.00Window(FlightReservation).Dialog(FlightsTable).WinButton(OK).ClickWindow(FlightReservation).WinEdit(Name:).SetgccWindow(FlightReservation).WinEdit(Tickets:).Type5Window(FlightReservation).WinEdit(Tickets:).SetSelection0,1Window(FlightReservation).WinEdit(Tickets:).Set5Window(FlightReservation).WinRadioButton(Business).SetWindow(FlightReservation).WinButton(InsertOrder).ClickWindow(FlightReservation).Close'退出订票界面EndIfwait(3)脚本录制结果脚本回放结果
本文标题:QTP测试实验报告-飞机票订票系统
链接地址:https://www.777doc.com/doc-7175301 .html