locked
Problem with mouse speed (Visual Studio and vstest.console.exe) RRS feed

  • Question

  • Hi,

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

    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 :

    [TestMethod]
    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

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

    6. 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.

    7. 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.


    • Edited by Mojohell Thursday, November 29, 2018 1:15 PM
    Thursday, November 29, 2018 1:03 PM

All replies

  • Hi Mojohell,

    We also get the same result as yours, if possible, you could report this issue to the product team:

    https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017?view=vs-2017

    If you submit it, you could share the link here, I will help you vote it.

    In addition, if we just visit the process working with the process monitor, it really has much more operations with the command line like loading dll files or others. Anyway, if you could report this feedback, please feel free to share it here:)

    Sincerely,

    Jack


    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 MSDNFSF@microsoft.com.

    Monday, December 3, 2018 1:48 AM
  • Hi Jack,

    I logged the defect on Visual Studio following the link but I did not get a confirmation message (and no link or historic of the defect). Maybe system has hard time to send it to my corporate account... May you provide the direct link where I should report the problem instead of using the VS ide.

    Also, as complement of information, the both machines where I have reproduced the problem have the same hardware: 8Go and I7-4770 CPU (Power Scheme set to "High Performance", so both CPU are always running 3.83GHz. I have done a previous test when one machine was set to "Balanced" but I had the same problem). There is no other task running while the problem occurs. And I did not check if the ThinkTimeMultiplier was different during execution but I kept the default settings (the Coded UI project is new).

    Thanks.

    Monday, December 3, 2018 1:42 PM
  • I finally got the link: https://developercommunity.visualstudio.com/content/problem/397154/problem-with-mouse-speed-visual-studio-and-vstestc-1.html
    Monday, December 3, 2018 4:06 PM
  • Vote it. Thanks for your feedback.

    Sincerely,

    Jack


    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 MSDNFSF@microsoft.com.

    Tuesday, December 4, 2018 1:23 AM