← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #678057]: capture command wrong using vnc

 

Question #678057 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678057

RaiMan proposed the following answer:
With VNC understanding the timing of a GUI is even more important than
with local screens:

client.type( "r", Key.WIN ) # action
client.capture().saveInBundle("1.png") # check

the action takes some milliseconds to complete, and triggers something
on the VNC screen, that in turn might take some time, to be completely
reflected in the vnc frame buffer on the local machine (the one running
the script)

in this case:
action: will open the run dialog 
check: a few milliseconds later will not yet see anything of this.

So if you want to use capture, to afterwards check the content of the
VNC screen after an action, you have to wait some time (duration depends
on the connection speed).

in this case as an example, the average time to update the frame buffer completely is assumed to be 2 seconds:
client.type( "r", Key.WIN )
wait(2) # might have to be adjusted
client.capture().saveInBundle("1.png")   

the intermediate
client.keyDown( Key.WIN )
client.keyUp()
does not make sense for me, since it surely changes, what is seen on the screen.

so assuming that Ausfuehren.png is a shot of the run dialog, this should
make more sense:

client = vncStart(ip="192.168.56.102", port=5900 )
wait( 5 )

client.type( "r", Key.WIN )

wait(2)
client.capture().saveInBundle("1.png")
wait( 5 )
client.capture().saveInBundle("2.png")

client.wait("Ausfuehren.png",10)
client.capture().saveInBundle("3.png")

if you then compare the images 1.png, 2.png, 3.png you will get a
feeling about the timing of your vnc connection.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.