Forum Discussion
Set page = Sys.Browser("*").Page("*")
The code above will recognize ANY page. If you have two pages, the Find() method will always work on the first page, that was found in the ObjectBrowser tree.
You need to recognize the proper page before you run any methods their.
What method i can use in place of Find() Method so that, i can make a logic to search both object on different pages
- baxatob6 years agoCommunity Hero
Find() method is good enough.
Can you describe your test case step by step? We'll try to find a solution.
- kaiiii6 years agoRegular Contributor
Set Document = page.NativeWebObject.Find("id", "skipUploadDocumentId", "p")
Set Registration_Confirm = page.NativeWebObject.Find("id", "inactive_div_id", "div")
After performing an action.. one of them object would be show on the next page.. so i have to put a delay
Here i am using the logic please check
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 Document = page.NativeWebObject.Find(PropertyName, KeyValue, TagName)Set Registration_Confirm = page.NativeWebObject.Find(PropertyName, KeyValue, TagName)
counter = counter+1
Loop Until Document.Exists = True Or Registration_Confirm .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 Functionafter calling this method i supposed to work but i am not getting the result
- baxatob6 years agoCommunity Hero
Function callDelay(time,PropertyName, KeyValue, TagName) ... Set Document = page.NativeWebObject.Find(PropertyName, KeyValue, TagName) Set Registration_Confirm = page.NativeWebObject.Find(PropertyName, KeyValue, TagName)
...Within the scope of the above function Document and Registration_Confirm objects are the same, because they are using the same arguments.
Related Content
- 7 months agopaarmann-ara
- 9 years agoteak
- 5 years agoToananas
Recent Discussions
- 13 hours agoSvetaG