Question

I was wondering if anyone new how to make the Automation Script in CodedUI wait for the web page to load before continuing on with the script.

So I fill out a form and press the "Continue" button, then the script times out because it gives up waiting. I realise I could use Playback.wait but then I would have code this each time I click continue.... and I have hundreds of scripts! Something similar to Seleniums WaitforBrowserLoad but for CodedUI

C# CodedUI in VS 2012

Any help would be appreciated.

Was it helpful?

Solution 2

You could also use:

Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads;

OTHER TIPS

In my experience, Coded UI is excellent about waiting for page loads to be complete before continuing test execution. That said, you can force a wait for a specific control to exist with WaitForControlExist method. This method is a member of the base class of all UI controls, UITestControl.

Sounds like your issue could be fixed if you create a settings file and increase the timeout.

Directions Here: Specifying Test Settings in Visual Studio

You could also call the WaitForControlReady method on the browser window object.

ex:

_browserWindow.WaitForControlReady(60000); //Should wait for 1 min
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top