← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #699748]: vnc unlock windows session

 

Question #699748 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/699748

    Status: Answered => Solved

Laurent IZAC confirmed that the question is solved:
IT WORKS !  Thanks

Please find below a working Python script example (the VNC server is
TightVNC in my case):

import sys
import shutil
import com.tigervnc.rfb.CMsgWriterV3
import com.tigervnc.rfb.Keysyms
import org.sikuli.vnc.VNCScreen as VNCScreen


vs = VNCScreen.start("<vnc_server>", <vnc_port>,  "<vnc_password>", 10, 1000)
    
if not vs:    
   print("Error connecting to VNC")
   exit(-1)
       
wait(1)
vs.click()
wait(1)

if(vs.exists("press_ctrl_alt_del_to_unlock.png")):
    print("we need to unlock the session")
    cc = vs.getClient().writer()
    cc.writeKeyEvent(Keysyms.Control_L, True)
    cc.writeKeyEvent(Keysyms.Alt_L, True)
    cc.writeKeyEvent(Keysyms.Delete, True)
    cc.writeKeyEvent(Keysyms.Delete, False)
    cc.writeKeyEvent(Keysyms.Alt_L, False)
    cc.writeKeyEvent(Keysyms.Control_L, False)

    wait(1)

vs.click(vs.wait("password_field.png",1))
wait(1)      
 
vs.type("<windows_password>"+Key.ENTER)
wait(1)      
    
vs.doubleClick(vs.wait("Google_icon.png",1))

[...]

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