Take the position x and y of the item on the screen

-2

I'm doing a test automation and I have to do a test that the mouse just goes over a menu, for the menu to open, it can not click.

However, I had to hit the position on the X and Y, but I would not like to do this, as other people will use it and we have different screen sizes.

I would like the automation to take the position automatically. To find the menu I have the attribute and menu value, is there any class that does this?

Can you help me with this? Follow the code I made

import java.awt.AWTException;
import java.awt.Robot;

public class ClasseRobot {

public static void main(String[] args) throws AWTException {
    Robot mouse = new Robot();

    mouse.delay(5000);
    mouse.mouseMove(200, 105);

}


}
    
asked by anonymous 26.12.2018 / 15:12

0 answers