10-25-2012, 05:26 PM
Hi all,
I am trying to create a function to check if a user specified Object exists.
3 Input values is the Object Type, Object Name, and Object Id.
for eg: when we use the
Browser("micClass:=Browser").Page("micClass:=Page").Obj_type(Obj_id).Exists
[/quote][/code]
I am trying to create a function to check if a user specified Object exists.
3 Input values is the Object Type, Object Name, and Object Id.
for eg: when we use the
Browser("micClass:=Browser").Page("micClass:=Page").Obj_type(Obj_id).Exists
[/quote][/code]
Code:
Function Obj_exists(Obj_type,Obj_name,Obj_id)
Set oPage = Browser("micClass:=Browser").Page("micClass:=Page")
//I tried the below code trying to use concatenation but it didnt work.
If oPage.& Obj_type & ( & Obj_id & ) & . & Exist Then
oPage.Obj_type(Obj_id).WaitProperty "Visible ","True "
oPage.Obj_type(Obj_id).highlight
Reporter.ReportEvent micPass,"Object Verification","The Object of name "& Obj_name &"type" & Obj_type & " exists."
else
Reporter.ReportEvent micFail,"Object Verification","The Object of name "& Obj_name &"type" & Obj_type & " does not exists."
End If
Set oPage = Nothing
End Function