condition of Delay method if there are chance of exist two different pages in automation
In the below i am trying to call delay for two different pages, if any one of them will exist it should be work but i am getting error when declaring object2.Exists = True.... Please help
Function callDelay(time,PropertyName, KeyValue, TagName)
Dim counter
'Delay Function using Counter Applied for PageLoading and calling home page .
Set page = Sys.Browser("*").Page("*")
Do
aqUtils.Delay 1000
Set object 1 = page.NativeWebObject.Find(PropertyName, KeyValue, TagName)
Set object2 = page.NativeWebObject.Find(PropertyName, KeyValue, TagName)
counter = counter+1
Loop Until object1.Exists = True or object2.Exists = True or counter >= time
If counter >=time then
Log.Error("Page can not be loaded......")
counter=0
page.FindChildByXPath("//a[@href='login.htm']").Click
Else
Log.Message("Time taken to : "&object.contentText&" "&counter&" Seconds")
End If
End Function