|
From: | Erdem Pulcu |
Subject: | automating GUI with java robot on Octave |
Date: | Mon, 13 Mar 2017 18:33:59 +0000 |
Dear Members,
I am trying to implement a function which was working perfectly fine in Matlab, and I am trying to implement the same in Octave. I am using a Windows 10 PC with Octave 4.2.1.
Initially when I was installing the Octave for the first time it complained that JRE were not installed, but I fixed this issue by installing and rebooting the program, so it doesn't flag this up anymore.
The Matlab code that I want to run on Octane is below, it should implement some mouse clicks on a GUI in an automated fashion.
robot = java.awt.Robot;
screenSizes = get(0, 'MonitorPositions');
store(loops,2)=zeros;
for i=1:loops
%Mouse to upper left of primary monitor
robot.mouseMove(1, 1)
%Mouse to center of primary monitor
robot.mouseMove(mean(screenSizes(1,[1 3])),mean(screenSizes(1,[2 4])))
%Mouse to hardcoded point 200 pixels down and 500 pixels to the right
robot.mouseMove(500, 200)
robot.mouseMove(170,85);
pause(1.5)
import java.awt.Robot;
import java.awt.event.*;
mouse = Robot;
%[rest of the code is not relevant so deleted for simplicity]
end
when I run the script Octave says in the command window
error: 'java' undefined near line bla bla bla
This GUI automation is very crucial thing for me, so I highly appreciate any recommendations (please give step by step details, as I am not so familiar of using Octave or Java, although fairly ok with Matlab)
Looking forward to hear from you all
Erdem
|
[Prev in Thread] | Current Thread | [Next in Thread] |