how to switch between remote desktop and local machine.(for ex.copy the content from local machine excel to remote desktop excel for some iterations).

Asked by hariprasadh

Hi ,

i tried to copy files from local to remote desktop once.But i dont know how to switch between local and remote desktop.(copying the content from file in local system and paste the content to file in remote desktop.

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

not a Sikuli question

Revision history for this message
hariprasadh (hariprasadh89) said :
#2

this is sikuli question.please find below the code which is used to take remote login by copying the xl file to remote.
  s=new Screen();
  s.type("image");//if i type image in desktop,the image.xls gets selected
     s.type("c",KeyModifier.CTRL);
  //to open the remote desktop
  App.open("C:\\Windows\\System32\\mstsc.exe");
  App myApp = new App("mstsc") ;
  s.wait(2.0);

      Toolkit toolkit = Toolkit.getDefaultToolkit();
      Dimension screenSize = toolkit.getScreenSize();
      Rectangle screenRect = new Rectangle(screenSize);
      System.out.println(screenRect.getBounds());
      Robot robot = new Robot();
      BufferedImage image = robot.createScreenCapture(screenRect);
      int height=image.getHeight();
      int width=image.getWidth();
      BufferedImage RemoteDesktopIcon=image.getSubimage(477, 130, 414, 250);

      BufferedImage TypeRDName_New1=image.getSubimage(559, 236, 243, 25);
      boolean t=ImageIO.write(image, "png", new File("C:\\Users\\hari\\Desktop\\Images\\image.png"));
       ImageIO.write(RemoteDesktopIcon, "png", new File("C:\\Users\\hari\\Desktop\\Images\\RemoteDesktopIcon.png"));
       ImageIO.write(TypeRDName_New1, "png", new File("C:\\Users\\hari\\Desktop\\Images\\TypeRDName_New1.png"));
  Region rdi=s.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\RemoteDesktopIcon.png"));
  Region rditype=s.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\TypeRDName_New1.png"));
  rdi.click(rditype);

  String pcname="PC144187";

  for(int i=0;i<=pcname.length();i++)
  {
   rdi.type(Key.BACKSPACE);
  }
  rdi.type(pcname);
  Region connect=rdi.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\Connect.png"));
  System.out.println(connect.getRect());
  rdi.click(connect);

  Region ws=s.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\WindowsSecurity.png"));
  ws.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\UserAccount.png"));
  ws.click(new Pattern("C:\\Users\\hari\\Desktop\\Images\\UserAccount.png"));

  ws.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\UserNameRMD.png"));
  ws.click(new Pattern("C:\\Users\\hari\\Desktop\\Images\\UserNameRMD.png"));
  ws.type("350734");

  ws.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\PasswordRMD.png"));
  ws.click(new Pattern("C:\\Users\\hari\\Desktop\\Images\\PasswordRMD.png"));
  ws.type("namasivaya89!");

  Region rokrmd=s.find(new Pattern("C:\\Users\\hari\\Desktop\\Images\\OKRMD1.png"));
  s.click(new Pattern("C:\\Users\\hari\\Desktop\\Images\\OKRMD1.png"));
  System.out.println("OKSize::::"+rokrmd.getRect());
  s.wait(8.0);
  s.type(Key.ENTER);

  //after that i need code to paste the copied file to remote desktop.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

ok

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.