Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Ok so I have been looking and have probably overlooked the answer.

So, I ask humbly for help from the most esteemed Perl Monks here.

I am trying to start an X-Motif GUI in background mode and export the display from the Unix Server to my Windows machine and then operate on the GUI using Win32::GUITest.

So far I have used Net::Telnet and of course when the process reachs the end of the session the GUI goes away so I can't even start to operate on it with Win32::GUITest, same for using system, backticks and such.

Any help would be appreciated.


I can post some code that I have if you think it would be helpful but at this time I think it may be more harmful to show what I have tried so as not to steer anyone down the rabbit hole I am in.

Replies are listed 'Best First'.
Re: Remote Session Starting
by Joost (Canon) on Feb 28, 2008 at 22:21 UTC
    How are you exporting the display? If you're using an X server on your windows machine, I would guess you won't be able to do anything useful with Win32::GUITest (except maybe close and move windows around, if your X server doesn't run in a single window). But I may be mistaken. I haven't tried that.

    Anyway, why would you end the session? As far as I can tell, you can just keep the session around while working with Win32::GUITest or whatever you want, and close the session when you're done. Or are you running some program that just immediately ends? If so, you should examine the docs for that program to see how to keep it running.

      So here is some of the code to do the exporting of the session, I am using Net::Telnet to get to the Unix Server:


      my($session);
      $session = new Net::Telnet
      (
      Timeout => 10,
      Prompt => $prompt
      );

      $session -> input_log($logFileName);
      $session -> open($host);
      $session -> login($username, $password);

      $session -> cmd("export DISPLAY=$ADDRNUM:0.0");
      print( STDOUT "Starting X-Motif GUI xrel in background mode\n" );
      $session -> cmd("xrel&");
      sleep 5;
        I am not sure how to operate on the GUI while in $session as the commands in Net::Telnet do not look like what I might need or want.

        If I get rid of the sleep the session goes away.