How to move mouse like a real user?

1 Answer 12 Views
Coded Steps Test Recording WPF Testing
Patrick
Top achievements
Rank 1
Patrick asked on 27 May 2025, 05:20 PM | edited on 27 May 2025, 05:20 PM

I have a WPF test that does some setup work, then moves the mouse to various positions on a map to draw a box. Once the box is complete then a double click completes the shape. After this a save button is clicked and other actions are performed.

The issue I am having is that all the setup actions work correctly and the post map actions work correctly, however all the map actions fail when the test is run. I believe this is because the mouse itself needs to move like a real user however I am unsure how to actually do this.

When the test is recorded then it produces multiple "LeftClick on X" actions which in code look like this:

Applications.XYZ.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 7, 45, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));

What I need is a similar command, but that moves the mouse from the current position to the recorded position and then clicks the left button. Other than this, it appears that everything seems to be working perfectly.

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 30 May 2025, 12:07 PM

Hi Patrick,

Test Studio action steps (click and type text steps) actually simulates real user behavior by default - for example the target element is set on focus and scrolled to visible before typing or clicking.

For the described scenario you can try using the options to adjust the mouse click action to be sent to a specific point in the target component. That way - by defining specific coordinates, you can create these 4 click steps so that they form the desired rectangle. Then you can add the Left Mouse click to finish the action on the map. 

Please, give this a try and let me know if it works for you.

Regards,
Elena
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Coded Steps Test Recording WPF Testing
Asked by
Patrick
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or