Robot operation coordinates

I am trying to use the robot operations for my shadow DOM website. I can use all of the operations without a problem except getting the coordinates right. There is no operation for getting the coordinates in the Robot Operation’s addon. I used the Execute JavaScript and the code given to get the coordinates. After using the coordinates I get from Execute JavaScript in Robot Operation’s click or move mouse test step, the result is different for the y value. For example, I get the coordinates x=1150, y=400 and I insert these coordinates in the x,y value for click or move mouse test step, but after running either test step, the mouse moves or clicks on x=1150,y= becomes different value (not 400). The x value stays the same while the y value becomes different. Why does this happen?

Hi @mgg7934.

Can you please share(you can send here a screenshot) how are you getting the Y value and adding it to the “Robot Operations” action? Are you storing the value into a parameter in the “execute JS” step, and then using the Parameter into the “Y” field?
If so, please open the recorder and run each step separately, and check its value after each step.

Thanks,
Ricardo

Hi @Ricardo.Caster

I haven’t used the x and y values by storing them as parameters yet. I have just entered them as input in the x and y coordinates. Also I have already run each step separately, that’s why I know it’s only the Y value that’s not running properly.

  1. getting the Y value using JS execute:
    image

and using this code:
document.onmousemove = function(e){
var x = e.clientX;
var y = e.clientY;
var a = e.clientX;
var b = e.clientY;
document.title = "X is “+x+” and Y is "+y;
e.target.title = "X is “+a+” and Y is "+b;
};

  1. adding the Y value to Robot Operations:
    image

Hi @mgg7934,
Your JavaScript command is showing you your web screen coordinates.
However, these are not your whole screen’s coordinates.
The ‘Robot’ actions are using coordinates that relate to your whole screen coordinates.
You can find a simple free tool (such as - ‘Mofiki’s Coordinate Finder’) to help you get the whole screen’s coordinates.

*Please note that the robot operations use ‘X’ and ‘Y’ coordinates in correlation to screen resolution (for example, 1080x1920px), so it may change your test results when running your test on other screen resolutions

It works by using this

@mgg7934 You are welcome.
Please contact us any time for help and information :slight_smile: