Coded UI WebTest, entered characters are sometimes omitted in edit fields

** AFTER UPDATE **

We use Visual Studio 2010 Coded UI for our system and integration tests in Microsoft Dynamics. I am an inexperienced Visual Studio user, but have experience in test automation.

Whenever the VS-Coded-UI Test prints text in the edit windows, it changes to one of the characters to be entered is omitted. The address field, for example Beverly Hills 90210

, could easily become Beverly ills 90210

, breaking my tests. This happens about 1 in 200 characters (educated guess).

Has anyone experienced this before? And where could the problem be: Speed ​​type VS, Broken keyboard driver, Hiccup browser so it can't get text input correctly, something else?

And is there any way to reduce the typing speed of the test driver in VS coded ui?

UPDATE , 2012-05-24: Still no solution found. I am using a job now that reduces the glitch, but it is still not perfect.

Work on the code (yes, it's dirty):

// put this method in a base class or easy accessable component
protected void ExecuteWithRetry(Action method, int maxRetryCount = 2)
{
    try
    {
        method();
    }
    catch (Exception)
    {
        if (maxRetryCount > 0)
        {
            ExecuteWithRetry(method, maxRetryCount - 1);
        }
        else
        {
            throw;
        }
    }
}

      

Whenever I use a piece of code where a textbox is set, I call it with this method:

UIMap.SetUserfieldsParams.EnterAddress = @"555 Sunset Boulevard";
UIMap.SetUserfieldsParams.EnterZIP = @"90210";
ExecuteWithRetry(UIMap.SetUserfields);

      

UPDATE , 2012-06-18: This seems to be caused by the impersonation we are using. The registered user of our web application is directly retrieved from the AD server by the username that launched IE. By running IE through impersonation, we can run our tests with other users without (manually) logging out and logging into Windows. We use Process.Start(ProcessStartInfo startInfo)

namespaced impersonationSystem.Diagnostics.Process

+3


source to share


1 answer


My first guess is that this is due to the fact that it prints quickly and your application is not ready to receive the next key. You can change the time between entered keys with KeyBoard.SendKeysDelay, the default on my machine is at least 10ms.



Do you still have the bug disabled? I'm surprised you don't get an exception that stops the test when you enter a value.

+3


source







All Articles