Highlighted
Contributor
Posts: 26
Registered: ‎02-10-2010

How can I increase the timeout period?

When I perform a specific action, the action seems to take longer to complete than TC's default period, causing an exception with the message "This operation returned because the timeout period expired. (Exception from
HRESULT: 0x8001011F".  



Through the C# API, how can I change the timeout period, and what is the current default timeout period?  



The only information I can find in the F1 docs are to use the Options Run Timeout property, but when I try to do "Connect.Options["Run"]["Timeout"] = 3000;" I get a NullReferenceException.


Contributor
Posts: 26
Registered: ‎02-10-2010

RE: How can I increase the timeout period?

Anyone have any idea on how to do this?
Staff
Posts: 1,866
Registered: ‎10-29-2010

RE: How can I increase the timeout period?

Hello Matthew,
 



Before accessing the TestComplete project's objects from within a connected application, you should call the Connect.RunTest routine. Please review the Running Connected and Self-Testing Applications help topic.



The Connect.Options["Run"]["Timeout"] property can be changed from within the TestComplete GUI (the Auto-wait timeout option of the Tools | Current Project Properties | Playback page). Its default value is 10000 ms.



If increasing of the auto-wait timeout period does not help, please provide us with the test code that contains the problematic line.

Best regards,
Allen
Contributor
Posts: 26
Registered: ‎02-10-2010

RE: How can I increase the timeout period?

Even starting my testing with




            // Connect to the Test Complete engine and start the project

            Connect.RunTest(testName, projectName, Path.GetFullPath(projectSuiteFile));

            Connect.Options["Run"]["Timeout"] = 20000;




still causes TC to time out after 10 seconds, not 20.
Contributor
Posts: 26
Registered: ‎02-10-2010

RE: How can I increase the timeout period?

Also, doing this through the Project options does not seem to take, at least not by TestExecute.
Staff
Posts: 838
Registered: ‎01-28-2014

RE: How can I increase the timeout period?

Hello Matthew,




It's quite unusual that you have failed to change the Auto-wait timeout option from within the connected application. If you still need to change the option from the connected application, please send us the connected application project using the Contact Support Form, and we'll help you do this.




However, I suppose that the 'This operation returned because the timeout period expired' exception points to a problem specific to open applications, and the Auto-wait timeout option will not resolve the problem. Instead of increasing this option, try setting the value of the  Method invoke timeout option to 10000 ms. To learn about this option, please see the Project Properties - General Open Applications Options help topic.




If increasing the method invoke timeout does not help, please provide us with the test code that contains the line that leads to the 'This operation returned because the timeout period expired' exception.
Contributor
Posts: 26
Registered: ‎02-10-2010

RE: How can I increase the timeout period?

Success!  Setting the Method invoke timeout seems to have fixed the issue!



Thank you for your reply Smiley Happy