Why Coded Ui execution is very slow RRS feed

All replies

  • Hi SrikarReddy,

    Welcome to MSDN forum.

    After research, I found an appropriate answer to boost execution time, please refer the below code from the answer:

    public class CodedUITest1
        public void TestInit()
            // Call a common routine to set up the test
        public void CodedUITestMethod1()
            // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    class MyCodedUITests
        /// <summary> Test startup. </summary>
        public static void StartTest()
            // Configure the playback engine
            Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled;  //allows the test to run at full speed. 
            Playback.PlaybackSettings.MaximumRetryCount = 10;  //wair for loading page then response
            Playback.PlaybackSettings.ShouldSearchFailFast = false;  //set full timeout to load page
            Playback.PlaybackSettings.DelayBetweenActions = 500;  //the delay time between the UI actions
            Playback.PlaybackSettings.SearchTimeout = 1000;  //the dafault is 3min
            // Add the error handler
            Playback.PlaybackError -= Playback_PlaybackError; // Remove the handler if it's already added
            Playback.PlaybackError += Playback_PlaybackError; // Ta dah...
        /// <summary> PlaybackError event handler. </summary>
        private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
            // Wait a second
            // Retry the failed test operation
            e.Result = PlaybackErrorOptions.Retry;

    After the experiment in my side, the execution time is reduced.

    Any feedback will be expected.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Tuesday, May 14, 2019 9:37 AM