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

Time out error

1 Answer 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gaurav
Top achievements
Rank 1
Gaurav asked on 21 Apr 2011, 05:42 PM
Hi Team,

I am trying trial version of Develop edition. I am creating script on silverlight application. I have recorded the script and converted all thet code in MSTest format. My recorded steps are like this

Step 1. Login in to the silverlight application
Step 2. Enter values in form appears after login.

Problem I am facing : Some times it throws time our error when it takes time to find objects on form(Step 2 above) after login. This issue occurs when login process takes some time.

To avoid this problem i have written code (for Step 2 as mentioned above) as below:

<after login>

Pages.Application.FrameContentFrame.Timeout = 1000000;

Pages.Application.FrameContentFrame.SilverlightApp.Timeout = 1000000;

Pages.Application.FrameContentFrame.SilverlightApp.FirstNameTextbox.Wait.ForExists(5000000);


But still some times it throws time out error for object 'FrameContentFrame'. Please suggest me perfect solution. Also direct me to some links(blog/forums) where i can go through advance level of commands( like changing tool setting, configuration for execution, wait, time delay etc) if possible.

1 Answer, 1 is accepted

Sort by
0
Accepted
Cody
Telerik team
answered on 25 Apr 2011, 06:39 PM
Hello Gaurav,

First I'd like to better understand your need for converting our web tests into coded unit tests in the MSTest format. We highly recommend keeping our web tests in their native .aii format. You can actually execute our .aii tests from MSTest as demonstrated in this video. Another advantage is you can set the WaitOnElementsTimeout parameter on each step as needed, as shown in the attached screenshot.

The problem you're running into in your code is that these lines of code do not work as expected:

Pages.Application.FrameContentFrame.Timeout = 1000000;
Pages.Application.FrameContentFrame.SilverlightApp.Timeout = 1000000;

The framework will actually perform a Get of the element within the webpage prior to setting the Timeout property. Unfortunately this "under the cover" Get operation has a fixed 5 second timeout built into it, essentially overriding the 1000000 timeout you're attempting to set.

The right way to wait for a frame to exist is something like this:

FrameInfo frameInfo = new FrameInfo("", "content", "", "", 0, true);
ActiveBrowser.WaitForFrame(frameInfo, 10000);


You can determine the correct parameters to use for the FrameInfo constructor by looking them up in your Pages.g.cs file and copying them from the FrameContentFrame definition in that file.

Greetings,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or