How can i point the mouse over a html element within the web browser?
Hi,
I am writing a functional test automation script to automate the file upload feature of a web application. I am using a tool called selenium to operate on the browser. This tool however does not support clicking on the file upload control hence I want to do this operation using java robot.
First I need to move the mouse pointer onto the html element (file upload control) displayed within a html page. I believe to do that i need to get the coordinates of the html element. I tried with the offsetLeft and offsetTop but those are just the relative coordinates (relative to the html document). I need the absolute screen coordinates. Is there a way to get the absolute screen coordinates? If not can you suggest a different approach?
Thanks for reading
Re: How can i point the mouse over a html element within the web browser?
You could try making it so that your robot will run when the screen is maximized, then the offsets are more or less based off of the whole screen.
Re: How can i point the mouse over a html element within the web browser?
The offset value is relative to the html file displayed within the browser. It does not take into account the menubar, toolbar or status bar of the browser. But the robot.mousemove(x,y) function takes absolute screen coordinates. BTW I am running the browser in maximized mode.