connect to a vncserver using vncscreen

Asked by Mohit sheth on 2018-06-15

Hi,

I only started working on sikuli a week ago, hence I am terribly new to this. I am trying to start Sikuli using the Java API on a remote (AWS EC2 Linux) instance. I have xfce GUI and a VNC server up and running and while logged into the instance via SSH, the following command works,

$ xvncviewer localhost::5901

Hence I assume for the Sikuli code that I have on AWS, using the VNCScreen with parameters for IP and Port as follows,

VNCScreen s= VNCScreen.start("127.0.0.1", 5901, "xxx", 10, 100);

should function as expected, unless I am missing some key step here. However, the VNCScreen.start() method returns a null, and I am not able to understand what I am doing incorrectly.

Should I connect directly to the vncserver from my local machine using portforwarding and run the script locally? I want to launch Firefox, and I am not sure how App.open() on a local script would open Firefox on the remote machine, hence from what I understand, the code should also execute remotely. Currently, the code opens firefox on the remote machine, but is unable to identify any marker on the screen, and hence s.wait(), s.find() etc. are not functional.

I would really appreciate some insight on this if possible, thank you.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-06-15
Last reply:
2018-06-16
RaiMan (raimund-hocke) said : #1

Be sure to use the latest nightly build of SikuliX 1.1.3

What about just using:
VNCScreen s= VNCScreen.start("127.0.0.1", 5901);

Does your the VNC server need a password?

Can you help with this problem?

Provide an answer of your own, or ask Mohit sheth for more information if necessary.

To post a message you must log in.