Forum Discussion
Find() method is good enough.
Can you describe your test case step by step? We'll try to find a solution.
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 Function
after 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.
- kaiiii6 years agoRegular Contributor
Hi, i got your point
will it work if i use different argument for 2nd object ??
i mean if i use Title or something extra
- baxatob6 years agoCommunity Hero
Give a try.
But on my point better to separate finding of elements. Like:
//p s e u d o c o d e function MyFind(Property, Value, Timeout) { return page.WaitProperty(Property, Value, Timeout) } function MyTest() { someAction() if MyFind(Property1, Value1, Timeout) { doSomething() } elif MyFind(Property2, Value2, Timeout) { doSomethingElse() }
else {
Log.Warning("Nothing was found")
{ }
Related Content
- 7 months agopaarmann-ara
- 9 years agoteak
- 5 years agoToananas
Recent Discussions
- 2 days agoGane195