软件测试习题-实现订票、退出、检查按钮有效性等功能并实现录制及运行功能(共三道题)

目录

一、前言

二、第一题(资源名称01)

一、题目

二、代码部分

三、第二题(资源名称02) 

 一、题目 

二、代码部分

四、第四题(资源名称02)

 一、题目

二、代码部分 


一、前言

下面提供了题目和代码,需要完整的请到我本人的资源中点击进行下载(名称下面已经标注,在括号里),使用的软件是三角型号标志的,录制和运行使用的一个小飞机,因为这个软件环境复杂,我把它删除了,当时忘记截图了,所以没有放图片跟使用教程。需要使用的可以看一下;

一共是三道题,可以看一下哪一个相同或类似就使用那个;

二、第一题(资源名称01)

一、题目

测试对象:Flight 4a系统
要求:
1.录制登录—订票—清空—退出的操作。
2.参数化脚本实现3个用户购买三张机票(不同时间不同起飞到达城市的机票只)
3.设置检查点检查日期和航班输入后“Flight”按钮的有效性。若有效采用自定义的方式将结果写入测试报告。

二、代码部分

Option explicit @@ hightlight id_;_1770944_;_script infofile_;_ZIP::ssf1.xml_;_
systemutil.Run "C:\Program Files (x86)\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set DataTable("name", dtGlobalSheet) @@ hightlight id_;_1771338_;_script infofile_;_ZIP::ssf2.xml_;_
Dialog("Login").WinEdit("Password:").SetSecure "637c3113f80d04965a74ed47bb165f53c2d0fdca" @@ hightlight id_;_2557030_;_script infofile_;_ZIP::ssf3.xml_;_
Dialog("Login").WinButton("OK").Click @@ hightlight id_;_1967512_;_script infofile_;_ZIP::ssf4.xml_;_
wait 3 @@ hightlight id_;_460638_;_script infofile_;_ZIP::ssf10.xml_;_
Window("Flight Reservation").ActiveX("MaskEdBox").Type DataTable("dete", dtGlobalSheet) @@ hightlight id_;_460638_;_script infofile_;_ZIP::ssf11.xml_;_
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable("qf", dtGlobalSheet) @@ hightlight id_;_2229254_;_script infofile_;_ZIP::ssf12.xml_;_
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable("dd", dtGlobalSheet) @@ hightlight id_;_1180024_;_script infofile_;_ZIP::ssf13.xml_;_
Dim res
res=Window("Flight Reservation").WinButton("FLIGHT").Check (CheckPoint("FLIGHT_2")) @@ hightlight id_;_2033048_;_script infofile_;_ZIP::ssf14.xml_;_
If res=True Then
	reporter.ReportEvent micPass,"检查Filight按钮有效性","有效"
Else
    reporter.ReportEvent micFail,"检查Filight按钮有效性","失败"
End If
wait 5
Window("Flight Reservation").WinButton("FLIGHT").Click @@ hightlight id_;_2033048_;_script infofile_;_ZIP::ssf15.xml_;_
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click @@ hightlight id_;_132994_;_script infofile_;_ZIP::ssf16.xml_;_
Window("Flight Reservation").WinEdit("Name:").Set "zzb" @@ hightlight id_;_2622566_;_script infofile_;_ZIP::ssf17.xml_;_
Window("Flight Reservation").WinButton("Insert Order").Click @@ hightlight id_;_2752580_;_script infofile_;_ZIP::ssf18.xml_;_
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"

三、第二题(资源名称02) 

 一、题目 

测试对象:Flight 4a系统
要求: 

1.录制登录---订票---退出的代码。
2.利用循环完成3个用户登录去购买机票。
3.随机选择出发到达城市信息,
4. 设置检查点检查检查“Insert Order”按钮是否可用,采用Reporter.ReportEvent方法将测试结果写入测试报告中。

二、代码部分
 

@@ hightlight id_;_2099002_;_script infofile_;_ZIP::ssf1.xml_;_
Option explicit
Dim i,name
name=array("Kate","Mary","Jack")
For i = 0 To 2 Step 1
	
systemutil.Run "C:\Program Files (x86)\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set name(i) @@ hightlight id_;_1639802_;_script infofile_;_ZIP::ssf2.xml_;_
Dialog("Login").WinEdit("Password:").SetSecure "637c32bfd8ee6d60da60b17364f6588c0de272fa" @@ hightlight id_;_1376882_;_script infofile_;_ZIP::ssf3.xml_;_
Dialog("Login").WinButton("OK").Click @@ hightlight id_;_1639712_;_script infofile_;_ZIP::ssf4.xml_;_
wait 3
Dim fcs,tcs '起飞到达城市数量
fcs=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
tcs=Window("Flight Reservation").WinComboBox("Fly To:").GetItemsCount
'计算起飞到达城市的数量
Window("Flight Reservation").ActiveX("MaskEdBox").Type "112526" @@ hightlight id_;_853776_;_script infofile_;_ZIP::ssf5.xml_;_
Window("Flight Reservation").WinComboBox("Fly From:").Select RandomNumber(0,fcs-1) @@ hightlight id_;_2295136_;_script infofile_;_ZIP::ssf6.xml_;_
Window("Flight Reservation").WinComboBox("Fly To:").Select RandomNumber(0,tcs-1) @@ hightlight id_;_1770832_;_script infofile_;_ZIP::ssf7.xml_;_
Window("Flight Reservation").WinButton("FLIGHT").Click @@ hightlight id_;_1705248_;_script infofile_;_ZIP::ssf8.xml_;_
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click @@ hightlight id_;_264058_;_script infofile_;_ZIP::ssf9.xml_;_
Window("Flight Reservation").WinEdit("Name:").Set "zzb" @@ hightlight id_;_1442418_;_script infofile_;_ZIP::ssf10.xml_;_
Dim res
res=Window("Flight Reservation").WinButton("Insert Order").Check (CheckPoint("Insert Order_2")) @@ hightlight id_;_2426264_;_script infofile_;_ZIP::ssf11.xml_;_
If res=True Then
	reporter.ReportEvent micPass,"检查Insert Oder 按钮有效性","有效"
Else
    reporter.ReportEvent micFail,"检查Insert Oder 按钮有效性","失败"
End If

Window("Flight Reservation").WinButton("Insert Order").Click @@ hightlight id_;_2426264_;_script infofile_;_ZIP::ssf12.xml_;_
wait 5
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"

Next

四、第四题(资源名称02)

 一、题目

测试对象:Flight 4a系统
要求:
1.录制登录—订票—退出代码。
2.实现舱位随机选择。
3.设置检查点检查订单编号格式是否正确,将测试结果采用自定义的方式写入测试报告。 

二、代码部分 

Option explicit
Dialog("Login").WinEdit("Agent Name:").Set "cccccc" @@ hightlight id_;_3671414_;_script infofile_;_ZIP::ssf1.xml_;_
Dialog("Login").WinEdit("Password:").SetSecure "637c386069cde451e6f4977cc129028b406f3575" @@ hightlight id_;_2360622_;_script infofile_;_ZIP::ssf2.xml_;_
Dialog("Login").WinButton("OK").Click @@ hightlight id_;_657302_;_script infofile_;_ZIP::ssf3.xml_;_
wait 3
Window("Flight Reservation").ActiveX("MaskEdBox").Type "112526" @@ hightlight id_;_198728_;_script infofile_;_ZIP::ssf4.xml_;_
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver" @@ hightlight id_;_3016512_;_script infofile_;_ZIP::ssf5.xml_;_
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurt" @@ hightlight id_;_526262_;_script infofile_;_ZIP::ssf6.xml_;_
Window("Flight Reservation").WinButton("FLIGHT").Click @@ hightlight id_;_722838_;_script infofile_;_ZIP::ssf7.xml_;_
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click @@ hightlight id_;_198726_;_script infofile_;_ZIP::ssf8.xml_;_
Window("Flight Reservation").WinEdit("Name:").Set "tom" @@ hightlight id_;_2426158_;_script infofile_;_ZIP::ssf9.xml_;_
'舱位随机选择
Dim cl
cl=RandomNumber(1,3)
If cl=1 Then
	Window("Flight Reservation").WinRadioButton("First").Set
ElseIf cl=2 Then
    Window("Flight Reservation").WinRadioButton("Business").Set
Else
    Window("Flight Reservation").WinRadioButton("Economy").Set
End If
 @@ hightlight id_;_3866922_;_script infofile_;_ZIP::ssf12.xml_;_
Window("Flight Reservation").WinButton("Insert Order").Click @@ hightlight id_;_3933600_;_script infofile_;_ZIP::ssf13.xml_;_
wait 5
'3.设置检查点检查订单编号格式是否正确
Dim res
res=Window("Flight Reservation").WinEdit("Order No:").Check (CheckPoint("Order No:")) @@ hightlight id_;_198754_;_script infofile_;_ZIP::ssf14.xml_;_
If res=True Then
	reporter.ReportEvent micPass,"检查订单编号的格式是否正确","格式正确"
Else
    reporter.ReportEvent micFail,"检查订单编号的格式是否正确","格式不正确"
End If
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姜鸿阳

谢谢您!感谢您的支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值