05-01-2013, 01:25 AM
I am trying to work on someone else Script. its throwing various errors for me .
I am sharing the code below and line number 486 throwing all types of error.
1. wrong argument
2. objects cannot find
3. type mismatch
please help
I am sharing the code below and line number 486 throwing all types of error.
1. wrong argument
2. objects cannot find
3. type mismatch
please help
Code:
Function PC_CreatePLan (headerData,ctrlCount)
Dim PlanHeaderDataCtrl()
Dim PlanHeaderDataCount
Print "Plan Header Data"
For i = 0 To ctrlCount-1
Print headerData(i)
Next
' msgbox ctrlCount
ReDim PlanHeaderDataCtrl(6)
PlanHeaderDataCtrl(0) = "name:=ctrl_marketSegment"
PlanHeaderDataCtrl(1) = "name:=ctrl_lob"
PlanHeaderDataCtrl(2) = "name:=ctrl_product"
PlanHeaderDataCtrl(3) = "name:=ctrl_planDesign"
PlanHeaderDataCtrl(4) = "name:=ctrl_funding"
'PlanHeaderDataCtrl(5) = "name:=ctrl_claimSystem" ' Changed as per CR183: NASCO now gets disabled, so dont need to select it
PlanHeaderDataCtrl(5) = "name:=ctrl_benefitPeriod"
PlanHeaderDataCount = Ubound(PlanHeaderDataCtrl)
Set PCPage = Browser("Horizon Blue Cross Blue").Page("Horizon – Plan Configurator") 'Page("Horizon – Plan Configurator")
If PCPage.Exist(10) Then
Set CreateNewPlan = PCPage.Link("name:=Create New Plan", "html tag:=A")
If CreateNewPlan.Exist(3)Then
CreateNewPlan.Click
Set EffectiveDate = PCPage.WebEdit("name:=ctrl_effectiveDate", "html tag:=INPUT")
If EffectiveDate.Exist(20) Then
EffectiveDate.Set Date
else
Reporter.ReportEvent micFail, "Failed to find","Effective Date"
ErrorCount = ErrorCount + 1
End If
Set NewPlanBrowser = Browser("Horizon Blue Cross Blue").Page("Horizon – Plan Configurator")
If NewPlanBrowser.Exist(3) Then
Set PlanDescription = NewPlanBrowser.WebEdit("name:=ctrl_description", "html tag:=INPUT")
If PlanDescription.Exist(3) Then
PlanDescription.Set "New Plan"
else
Reporter.ReportEvent micFail, "Failed to find", "Plan Description Edit box"
ErrorCount = ErrorCount + 1
End If
For i= 0TO PlanHeaderDataCount-1
Set PlanData = PCPage.WebList(PlanHeaderDataCtrl(i), "html tag:=SELECT")
wait(5)
If PlanData.Exist(60) Then
PlanData.Select PlanHeaderDataCtrl(i)[/color]
else
Reporter.ReportEvent micFail, "Failed to find", headerData(i)
ErrorCount = ErrorCount + 1
End If
Next
else
Reporter.ReportEvent micFail, "Failed to find","Create New Plan Browser"
ErrorCount = ErrorCount + 1
End If
else
Reporter.ReportEvent micFail, "Failed to find","Create New Plan link"
ErrorCount = ErrorCount + 1
End If
else
Reporter.ReportEvent micFail, "Failed to find", "Hz BCB Page"
ErrorCount = ErrorCount + 1
End If
'Destroy the objects
Set HzBCBBrowser = Nothing
Set HzBCBPage = Nothing
Set CreateNewPlan = Nothing
Set NewPlanBrowser = Nothing
Set PlanDescription = Nothing
Set PlanData = Nothing
End Function
''****************************************