This is a migrated thread and some comments may be shown as answers.

Wait for condition has timed out in Chrome/Safari

3 Answers 122 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 17 Apr 2012, 03:38 AM
Hello

After logging into a system and getting and bunch of information, i then have a coded step to search through a table to find the correct button to push and then push it and then continue on with some other steps and subtests.

In IE and FF this works fine however in Safari I keep getting the error below.  I note that it does find the correct button and appears to push it (noticed by the browser refreshing) but does not continue on to the next step.  I have tried increasing the debugger timeouts but that hasn't helped. 

Any ideas?

the code to push the button after finding the ID =

Dim ClickAnchor As HtmlAnchor = Pages.TravelInsuranceSalesSystem0.FrameCtl00Contents1.ContentsTable.Find.ByExpression(Of HtmlAnchor)("id=" & findbutton)

 

ClickAnchor.Click

 


It is the ClickAnchor.Click line that the error is referring to.

Failure Information: ~~~~~~~~~~~~~~~Exception thrown executing coded step: '[Step__Find_and_Click_Buy_Policy_Button_CodedStep] : Find and Click Buy Policy Button'.InnerException:System.TimeoutException: Wait for condition has timed out at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo) at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType) at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout) at ArtOfTest.WebAii.Core.Browser.WaitUntilReady() at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady) at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request) at ArtOfTest.WebAii.Core.Actions.Click(Element targetElement) at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.Click() at Step___Find_and_Click_Buy_Policy_Button.Step__Find_and_Click_Buy_Policy_Button_CodedStep() in J:\Common Shared\Customer\CTI\Test\Step - Find and Click Buy Policy Button.tstest.vb:line 96

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 17 Apr 2012, 02:39 PM
Hello Cheryl,

I am sorry you are running into this problem. Please see this article on how to resolve the error. If you want to do this in code, you can change the last line from: ClickAnchor.Click() to ClickAnchor.MouseClick().

Let me know if you need further assistance on this.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Cheryl
Top achievements
Rank 1
answered on 17 Apr 2012, 11:07 PM
Thank you for your reply.  This solution (using MouseClick()) worked for Safari, but for Chrome it fails on the Dim line, prior to the button click, where the error looks like its trying to wait for a frame.  The button that is found is in a table on a master page component

Dim ClickAnchor As HtmlAnchor = Pages.TravelInsuranceSalesSystem0.FrameCtl00Contents1.ContentsTable.Find.ByExpression(Of HtmlAnchor)("id=" & findbutton)

The error is:


InnerException:System.TimeoutException: Wait for condition has timed out at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo) at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout) at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Int32 timeout) at ArtOfTest.WebAii.Core.Browser.WaitForFrame(FrameInfo frameInfo, Int32 timeout) at ArtOfTest.WebAii.Core.Browser.WaitForFrame(FrameInfo frameInfo) at Pages.TravelInsuranceSalesSystem0Page.get_FrameCtl00Contents1() in J:\Common Shared\Customer\CTI\Test\Pages.g.vb:line 168 at Step___Find_and_Click_Buy_Policy_Button.Step__Find_and_Click_Buy_Policy_Button_CodedStep() in J:\Common Shared\Customer\CTI\Test\Step - Find and Click Buy Policy Button.tstest.vb:line 97


0
Plamen
Telerik team
answered on 20 Apr 2012, 11:55 AM
Hello Cheryl,

This error means that Test Studio timed out waiting for the frame to return to a ready state. Since the frame didn't return ready with content, Test Studio cannot proceed to find the 'HtmlAnchor' element.
 
To overcome this try adding the following lines of code:
ActiveBrowser.Frames.RefreshAllDomTrees()
ActiveBrowser.Frames.WaitAllUntilReady()
 
Dim ClickAnchor As HtmlAnchor = Pages.TravelInsuranceSalesSystem0.FrameCtl00Contents1.ContentsTable.Find.ByExpression(Of HtmlAnchor)("id=" & findbutton)

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Cheryl
Top achievements
Rank 1
Share this question
or