UTF 测试报告
1、对于飞机案例,判断下拉列表选项的正确性,并输出结果
#定义数组存放正确的列表
flyfrom = Array("Denver","Frankfurt","London","Los Angeles","Paris","Portland","San Francisco","Seattle","Sydney","Zurich")
#获取FlyFrom 下拉列表选项相关属性
print Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount '显示下拉列表总数 print Window("Flight Reservation").WinComboBox("Fly From:").GetContent '显示下拉列表选项 msgbox Window("Flight Reservation").WinComboBox("Fly From:").GetItem(0) '显示下拉列表选项
#比对FlyFrom 下拉列表选项值与参数是否一致
'定义变量 Set flyf =Window("Flight Reservation").WinComboBox("Fly From:") 'Set flyt =window("Flight Reservation").winCombobox("Fly To:") Sub fly(flyf,flyfrom) For i = 1 To flyf.GetItemsCount-1 '如果选取的值与预期一致 If flyf.GetItem(i) = flyfrom(i) Then '输出结果使用Reporter.ReportEvent Reporter.ReportEvent micPass,i,"is rigth" Else Reporter.ReportEvent micFail,i,"is wrong" End If Next End Sub '调用函数 Call fly(flyf,flyfrom)
#执行结果测试报告