我创建了一个相当简单的函数,但我一定忽略了一些东西,因为我在保存时遇到了 3 个错误:
- 预期的 ')'
- 预期的语句结束
- 预期的 End Sub 或 End 函数或 End 属性
这是代码:
Function ReportCheck(sParent, sReport, sTitle)
oParentWindow = "My_Reports," & sParent
BuildAndRunObject "My_Reports" , sReport,"LINK", "CLICK","","", "ABORT","","","",""
BuildAndRunObject oParentWindow ,sTitle,"WEBELEMENT", "EXIST","","", "","","","",""
'BuildAndRunObject oParentWindow ,"select","WEBELEMENT", "SELECT","2009 - 2013","SELECT_VALUE", "ABORT","","","",""
BuildAndRunObject oParentWindow ,"Create","WEBBUTTON", "CLICK","","", "ABORT","","","",""
Wait(20)
If BuildAndReportObject(oParentWindow, "Checkmark", "WEBELEMENT","VERIFY PROPERTY VALUE".TRUE. "VISIBLE","","","","","") and BuildAndReportObject(oParentWindow, "Report_Ready", "WEBELEMENT","VERIFY PROPERTY VALUE". TRUE. "VISIBLE","","","","","") Then
Reporter.ReportEvent micPass, "Credit Summary", "Report Generated Successfully"
Else
Reporter.ReportEvent micFail, sTitle, "Report Failed to Generate"
End if
End Function
第一个错误是针对 IF 线的。第二个错误是针对 Else。最后一个是 End If 行。
我错过了什么?我很欣赏第二次看。我是我公司唯一一个使用 VB Script 的人,所以我没有人看...
谢谢,
杰米