1

The mouse speed displacement is not constant when using command prompt depending if Visual Studio is open or not.

I am looking for a resolution to this problem.

Environment:

Windows 10 Enterprise 1803 (17134.407)

VS Test Agent 2017 15.9.2

VS Enterprise 2017 15.9.2

Steps

  1. Creates a Coded UI project (.net 4.7.1).

  2. Add the following test method :

    public void CodedUITestMethod1() { Mouse.Move(new Point(10, 10)); var start = DateTime.Now; Console.WriteLine($"MouseMoveSpeed={Mouse.MouseMoveSpeed.ToString()}"); Mouse.Move(new Point(500, 500)); Console.WriteLine($"Time= {DateTime.Now - start}, MouseMoveSpeed= Mouse.MouseMoveSpeed.ToString()}"); }

  3. Run the test from Visual Studio and note the standard output (I got: Time=00:00:01.7835117, MouseMoveSpeed=450).

  4. Close all instances of Visual Studio and execute the previous test method from a command prompt:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\Users\fakeUser\Source\Repos\CodedUITestProject1\bin\Release\CodedUITestProject1.dll" /Logger:trx

  1. Check the standard output from the test result in trx file (I got: Time=00:00:10.3616613, MouseMoveSpeed=450)

  2. Open an instance of Visual Studio (don't need to open the project, it can be the view of the Trx file for example) and run again the test method from the command prompt.

  3. Check the standard output from the test result in trx file (I got: Time=00:00:01.8037781, MouseMoveSpeed=450)

Actual Result:

When Visual Studio is open, the mouse is faster when executing the test method by vstest.console.exe.

Expected Result:

The mouse displacement remains the same no matter the executive method.

FYI:

  • I have the same result on a fresh installation of Windows 10 Professional with only VS Test Agent installed (no Visual Studio).

  • MSTest instead of VSTest from command prompt gives the same result (slower than when Visual Studio session is opened).

  • You have to execute a Test method from Visual Studio first before to run command prompt (follow the steps order). Maybe a dependency loaded by Visual Studio creates this behavior.

0 Answers0