Forum Discussion
paramveer
15 years agoContributor
Hi Robert Martin,
I there any way to work with both the approaches like first i search my object with namemapping and Is the object not found then i automatically use the properties added in namemapping corresponding to that object to use with .Find method e.g
Function k_clickLink(PageName,ObjectName,oRow)
If PageName <> "" then
a=k_ObjectExistence(PageName,ObjectName)
Eval("Aliases.iexplore." & PageName & "." & ObjectName & ".Click")
Log.Message ("Click operation performed on " & ObjectName)
End if
End Function
Function k_ObjectExistence(PageName,ObjectName)
Dim Page_Name, Object_Name
Page_Name = PageName
Object_Name = ObjectName
For i = 1 to 5
If Eval("Aliases.iexplore." & Page_Name & "." & Object_Name &".Exists" ) = "True" then
Log.Message (Object_Name & " exists on the page " & Page_Name)
exit for
else
Log.Message ("Checking existance of " & Object_Name & " in iteration " & i & " on page "& Page_Name)
delay(2000)
Aliases.iexplore.Page_Name.Refresh
End if
Next
End Function
Here in above example what i m doing is, I create a NameMapping file and Used extended find for all objects so that my objects comes just under my page in the hierarchy. I made a function "k_ObjectExistence" just to check the existance of object using Exists method.
I want any solution in which if my objects doesn't gets identified on the page using Aliases my function will return any True/False value basis which I use properties of objects defined in the NameMapping to use with .Find method in the same function defined above.
...Thanks in advance
I there any way to work with both the approaches like first i search my object with namemapping and Is the object not found then i automatically use the properties added in namemapping corresponding to that object to use with .Find method e.g
Function k_clickLink(PageName,ObjectName,oRow)
If PageName <> "" then
a=k_ObjectExistence(PageName,ObjectName)
Eval("Aliases.iexplore." & PageName & "." & ObjectName & ".Click")
Log.Message ("Click operation performed on " & ObjectName)
End if
End Function
Function k_ObjectExistence(PageName,ObjectName)
Dim Page_Name, Object_Name
Page_Name = PageName
Object_Name = ObjectName
For i = 1 to 5
If Eval("Aliases.iexplore." & Page_Name & "." & Object_Name &".Exists" ) = "True" then
Log.Message (Object_Name & " exists on the page " & Page_Name)
exit for
else
Log.Message ("Checking existance of " & Object_Name & " in iteration " & i & " on page "& Page_Name)
delay(2000)
Aliases.iexplore.Page_Name.Refresh
End if
Next
End Function
Here in above example what i m doing is, I create a NameMapping file and Used extended find for all objects so that my objects comes just under my page in the hierarchy. I made a function "k_ObjectExistence" just to check the existance of object using Exists method.
I want any solution in which if my objects doesn't gets identified on the page using Aliases my function will return any True/False value basis which I use properties of objects defined in the NameMapping to use with .Find method in the same function defined above.
...Thanks in advance