鑫沫露影 发表于 2015-4-20 14:04:15

QTP编写登录模块的脚本 有页面弹出框

本帖最后由 鑫沫露影 于 2015-4-21 11:46 编辑

Dim i
Dim outputvalue
Dim istatus
For i=1 to DataTable.GetSheet ("Action1").GetRowCount
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5").WebEdit("userId").Set DataTable("username", dtLocalSheet)
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5").WebEdit("userPwd").SetSecure DataTable("password", dtLocalSheet)
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5").Image("userLogin_button").Click
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5_2").Sync
Window("Windows Internet Explorer").Dialog("来自网页的消息").WinButton("确定").Click
Window("Windows Internet Explorer").Dialog("来自网页的消息").Output CheckPoint("实际值")
outputvalue=DataTable("output",dtlocalsheet)
istatus=DataTable("status",dtlocalsheet)
Ifoutputvalue <> istatusThen
   Reporter.ReportEvent1, "测试预期结果:"+ istatus , "实际结果:"+outputvalue
else
   Reporter.ReportEvent0, "测试预期结果:"+ istatus , "实际结果:"+outputvalue
End If
DataTable.GetSheet("Action1").SetNextRow
next
Browser("OA8000旗舰版_FUMYSQL5").CloseAllTabs







报错提示:The "实际值" CheckPoint object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.
Line (10): "Window("Windows Internet Explorer").Dialog("来自网页的消息").Output CheckPoint("实际值")".
但发现“实际值”这个对象添加不进去






saharaqs 发表于 2015-4-21 10:43:58

为什么不把错误信息贴出来?

鑫沫露影 发表于 2015-4-21 11:44:21

Dim i
Dim outputvalue
Dim istatus
For i=1 to DataTable.GetSheet ("Action1").GetRowCount
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5").WebEdit("userId").Set DataTable("username", dtLocalSheet)
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5").WebEdit("userPwd").SetSecure DataTable("password", dtLocalSheet)
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5").Image("userLogin_button").Click
Browser("OA8000旗舰版_FUMYSQL5").Page("OA8000旗舰版_FUMYSQL5_2").Sync
Window("Windows Internet Explorer").Dialog("来自网页的消息").WinButton("确定").Click
Window("Windows Internet Explorer").Dialog("来自网页的消息").Output CheckPoint("实际值")
outputvalue=DataTable("output",dtlocalsheet)
istatus=DataTable("status",dtlocalsheet)
Ifoutputvalue <> istatusThen
   Reporter.ReportEvent1, "测试预期结果:"+ istatus , "实际结果:"+outputvalue
       else
   Reporter.ReportEvent0, "测试预期结果:"+ istatus , "实际结果:"+outputvalue
End If
DataTable.GetSheet("Action1").SetNextRow
next
Browser("OA8000旗舰版_FUMYSQL5").CloseAllTabs
错误信息提示:The "实际值" CheckPoint object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.

Line (10): "Window("Windows Internet Explorer").Dialog("来自网页的消息").Output CheckPoint("实际值")".

发现这个“实际值对象总是添加不进去”














页: [1]
查看完整版本: QTP编写登录模块的脚本 有页面弹出框