Uipath make random click in image

I want to make a simple robot with 2 steps:

  1. Open a picture by Windows Paint
  2. Make a sequence of 10 clicks at random spot on this image

Step 1 is fine, but I got stuck at step 2. I cannot make a click at random spot inside image. I have tried to change offset with random number: new Random().Next(1, 100) but it doesn’t work. It always clicks at same spot. Following image is my code. I know I need to change target and offset, but don’t know how to change it. Please help

Hope the following sample helps you.

Sample20230818-2L.zip (20.9 KB)


Thank you for your help. I downloaded your example, and it works.
But I still cannot discriminate differences between my click config and your click config. So please let me ask more question about your example.
I see some changes you made:

  • increase random factor in offset config (from new Random().Next(1, 100) to new Random().Next(1, 500) )
  • use strict selector, and I can see your select a big region (my text in top post).

Is this enough ? Are there more custom config I need to change ?
If 2 above changes are enough, I think my problem may be my selector region is too small, so it always click same spot.


Which input mode do you set? It’s necessary to set Hardware Event.


I set “Same as app/browser”(default option) for input mode

Can you try to set HardwareEvent explicitly?

thank you now it works now with my example

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.