WaitFor fails while Prompt works - WeOnlyDo Discussion board

WaitFor fails while Prompt works (General questions)

by novanstar, Saturday, November 01, 2008, 00:06 (5866 days ago)

Hi,
I am evaluating wodSSH for use in test automation. I am using Perl to request wodSSH COM object. My test code works if I specify Prompt before connection. But it would fail (got stuck) if I use WaitFor after connection instead. Can someone help me out? Thanks. (The target is Ubuntu Linux running sshd.)

==== code that WORKS ====
my $ssh = Win32::OLE->new( WeOnlyDo.wodSSHCom.1 );
$ssh->{Protocol} = 4;
$ssh->{HostName} = 'auto-dev03';
$ssh->{Blocking} = 'True';
$ssh->{Login} = 'autodev';
$ssh->{Prompt} = 'autodev@auto-dev03:~$ ';
$ssh->{Password} = 'password';
$ssh->Connect();
$ssh->Execute( ls
);
print $ssh->Receive();
print $ssh->Receive();
==========================

# if remove $ssh->{Prompt}... and use WaitFor instead, then it got
# stuck
$ssh->Connect();
$ssh->WaitFor('autodev@auto-dev03:~$ ');
$ssh->Execute( ls
, 'autodev@auto-dev03:~$ ');
print $ssh->Receive();
print $ssh->Receive();


Complete thread: