QTP设置checkpoint,运行时报:类型不匹配: 'CheckPoint'
CurrentRow = Parameter("row")Do
CurrentRow = CurrentRow+1
DataTable.GetSheet("Login").SetCurrentRow(CurrentRow)
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").WebEdit("userName").Set DataTable("p_Name","Login") @@ hightlight id_;_Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").WebEdit("userName")_;_script infofile_;_ZIP::ssf2.xml_;_
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").WebEdit("password").SetSecure DataTable("p_Password","Login") @@ hightlight id_;_Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").WebEdit("password")_;_script infofile_;_ZIP::ssf3.xml_;_
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").Image("Login").Click 37,8
bCheck = Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").Check ( CheckPoint("If you don't have a log-in"))
If not bCheck Then
RunAction "Booking",0
Exit Do
End If
Loop until (CurrentRow = DataTable.GetSheet("login").GetRowCount)
MsgBox "At the end of Relogin"
运行到这一句 bCheck = Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").Check ( CheckPoint("If you don't have a log-in"))
时报“类型不匹配: 'CheckPoint'”。百度上面找不到原因,官方提供的help里面只说到这样写返回的是布尔值。
求指导!! 如果你想获取checkpoint的返回值(一个布尔值,表示检查成功或失败),你必须在专家模式下将checkpoint参数两端加上括号。如a = browser("MyBrowser").page("MyPage").check(checkPoint("MyProperty")),另外,你检查的是文本内容吗?那需要添加的是文本检查点
。
页:
[1]