Mouse click to accept dynamic coordinates

Janus, when you record a mouse click and then change the settings of the action from “Click on image” to “Click on coordinates”, the coordinates are defined automatically.

Hi, the Co-ordinates just end up clicking on other places and not where you set them from the image click. when changing to coordinates it doesnt work

@nontobeko.mlambo We had a bug with coordinates in the previous releases. It has been fixed for RPA Express 2.0, which will be officially released tomorrow.

@nontobeko.mlambo The bug with coordinates has been fixed in RPA Express 2.0.


Hi, could you confirm that dynamic coordinates is still not possible? If I edit the code generated, could I use a dynamic variable?


Dynamic coordinates IS possible (see attached script) dynamicMouseClick.txt (453 Bytes)

In general you can do pretty much EVERYTHING with “custom actions” since it can execute java code.
If you want to use a workfusion fonctionnality out of the box, just export your rpae as bot task, and see what is the line of code that executes the desired operation. Then you can use this line in your rpae project in “custom actions”.

Now answering @dimitrios_nt, you can also get current coordinates of the mouse (using java code). For a working example, you can see the code of my post here:



Thanks a ton! Let me try and do that :slight_smile:

1 Like

I seem to be doing something wrong, I am trying to extract the X,Y position of my mouse using a variation of the second script.
I am getting an error for this: General error during canonicalization: Output parameter should be defined as variable name.
I have defined it in the recorder variables though.
Could you help me?
Thank you!

script rec_var

Hi @SaurabNair.
Looking at your script and it seems to me that you missed starting quote before “mouse_x” parameter:
You can compare how it should look on the page with the samples of Custom script:


Thanks Lera - I made that change, but the error is still there. Could you tell me what I could do further? error.txt (14.6 KB)

Strange. Let’s save your script (make sure that all your variables are equal to script output variables), close Studio and run again.
If this didn’t help, please remove and create back output variables in Studio and save the script without running. Then run it again.

Also, may I suggest you to change

mouse_x = MouseInfo.getPointerInfo().getLocation().x
mouse_y = MouseInfo.getPointerInfo().getLocation().y


mouse_x = RNumber.of(MouseInfo.getPointerInfo().getLocation().x)
mouse_y = RNumber.of(MouseInfo.getPointerInfo().getLocation().y)

Since mouse_x and mouse_y are RPA variables


Hi, thank you for trying to help me. I tried both suggestions but it still doesn’t work.
I am attaching the screnshot where you can see the recorder variables are pre-defined.
Do I need some plugin which I am missing? I am also attaching the error message.error.txt (47.9 KB)

@SaurabNair, are you trying to create Bot Task? Or do you use Custom Script in Actions Flow?

I am using custom scripts in action flow. I exported the code to see if something was amiss in the above XML.

Ah, I see what’s the issue! :bulb:
You have 2 output parameters, but there is the only one can be used in Custom Script. It’s also mentioned in this guide:


Thanks a ton @Lera That worked, but now I am running into another issue.
MouseInfo seems to be a missing property- although I know it exists in Java. Any suggestions? I am trying to get the x-coordinate of my mouse position.

@SaurabNair, please add in the beginning of script import java.awt.*

I tested and it works on my side:


Thanks a ton @Lera! Just one further question- how would I know when to import explicitly?

Also, I am now trying to use the stored X and Y coordinates as a future mouse click. The X and Y positions are recording perfectly.mousePos
I then tried using the code below:

but it is resulting in the error below.
Could you tell me what I need to do?