I’m working on a spaghetti code hellscape of a project that needs to be tested. Refactoring is a non-starter as it would be a massive overhaul and the project is currently already in production, so I am trying to make a java.awt.Robot
.
Right now I am just trying to get it to be able to navigate between the different screens when triggered via a client event script (Control + O if that matters). Here is my script
import java.awt.Robot
ROBOT_DELAY_MS = 1000
WINDOW_SELECT_PIXELS = {
"Overview": (500, 500),
"Privleged Access": (500, 600)
}
rob = java.awt.Robot()
rob.delay(ROBOT_DELAY_MS)
def goToWindow(window):
"""
Goes to a specific window via bottom navigation.
Args:
window: str, which window do you want to go to?
Returns:
None, moves mouse and clicks button, or throws KeyError if bad window name
"""
print "going to window %s"%(window)
x, y = WINDOW_SELECT_PIXELS[window]
print "x and y coordinates are %i, %i"%(x, y)
rob.mouseMove(x, y)
and in my client event script I am calling goToWindow("Overview")
. I see my print statements but my mouse does not move nor do I get an error (which I was previously from a typo) so I don’t think I have anything wrong in my script, but the mouse is not moving. What am I missing here? Using 7.9.9.