vendredi 4 septembre 2015

How to improve Coded UI playback stability

I noticed that Coded UI test case playback is working inconsistently depending on the machine and environment. Specifically say I have a test case which worked fine on one machines but it started keep failing on another machine.

Where is it failing ?

I have few combo boxes in the web page and coded to set values for these controls. I have few other controls which are coded in the same way but they works successfully in all iterations.

How do I populate combo boxes ?

MyTab.MyCombo.SelectedItem = data

What is happening ? the above line of code fails inconstantly

  1. If I tried 5 times, then it fails 3-4 times

  2. After I added the below command, successful rates increased but it still fails.

    MyTab.MyCombo.WaitForControlReady()

  3. I added Mouse.Click(MyTab.MyCombo) before setting value - successful rate increased but it still fails

It was successful in all iterations after adding the below command

Playback.PlaybackSettings.WaitForReadyLevel = Microsoft.VisualStudio.TestTools.UITest.Extension.WaitForReadyLevel.AllThreads

When I set to WaitForReadyLevel.AllThreads it degrades the performance of playback painfully, so I don't want to use it.

What about using WaitForReadyLevel.UIThreads It did not give any impact.

Experts please provide some suggestions or help me to fix this.

Aucun commentaire:

Enregistrer un commentaire