微笑是最美 发表于 2019-1-8 13:54:35

UFT,运行报错,类型不匹配

'2.替换对应的数据定义变量 @@ hightlight id_;_724022_;_script infofile_;_ZIP::ssf7.xml_;_

Dim username,password

'4.定义期望结果和实际结果变量
Dim qiwang,shiji
'1.导入测试用例文件
datatable.ImportSheet "d:\datalin.xls",1,"Action1"
username=datatable("username","Action1")'获取Excel文件对应的数据的测试用例,注获取列名
password=datatable("password","Action1")
Dialog("Login").WinEdit("Agent Name:").Set username @@ hightlight id_;_265284_;_script infofile_;_ZIP::ssf8.xml_;_
Dialog("Login").WinEdit("Password:").Set password @@ hightlight id_;_593826_;_script infofile_;_ZIP::ssf4.xml_;_
Dialog("Login").WinButton("OK").Click @@ hightlight id_;_528236_;_script infofile_;_ZIP::ssf5.xml_;_


'3.判断测试用例有几条
If Dialog("Login").Dialog("Flight Reservations").Exist(3) Then
    qiwang=datatable("qiwangjieguo","Action1")
    shiji=Dialog("Login").Dialog("Flight Reservations").Static("Please enter agent name").GetROProperty("text")'获取对话框提示信息
    If qiwang=shiji Then
      datable("ceshijieguo","Action1")="pass"
    else
      datable("ceshijieguo","Action1")="faill"
      datable("shijijieguo","Action1")=shiji
    End If
    dialog ("Login").Dialog("Flight Reservations").winButton("确定").Click
   
End If
'Window("Flight Reservation").Close

页: [1]
查看完整版本: UFT,运行报错,类型不匹配