51Testing软件测试论坛

标题: QTP编写登录模块的脚本 有页面弹出框 [打印本页]

作者: 鑫沫露影    时间: 2015-4-20 14:04
标题: 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)
If  outputvalue <> istatus  Then
     Reporter.ReportEvent  1, "测试预期结果:"+ istatus , "实际结果:"+outputvalue
  else
   Reporter.ReportEvent  0, "测试预期结果:"+ 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
为什么不把错误信息贴出来?
作者: 鑫沫露影    时间: 2015-4-21 11:44
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)
If  outputvalue <> istatus  Then
     Reporter.ReportEvent  1, "测试预期结果:"+ istatus , "实际结果:"+outputvalue
         else
   Reporter.ReportEvent  0, "测试预期结果:"+ 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("实际值")".

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



















欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2