Using SSH library to send command lines to remote machine

1,130 views
Skip to first unread message

zubinix

unread,
Jan 21, 2009, 11:02:38 PM1/21/09
to robotframework-users
Hi all

I've just started using this framework and I'm having problems using
the SSH library to execute a simple command line like 'cd /usr/local/
bin'.

Using the Robot IDE I can use the Open Connection and Login commands
to start a SSH session to the remote client. Then I try something
like:

Execute Command | cd /usr/local/bin |

where '|' delineates the borders of the cells in the Robot IDE test
case form.

The command above does not work but a command without arguments i.e.

Execute Command | pwd

works correctly. I've tried to putting quotes and using separate cells
for the argument but nothing works. So the questions is how do I
execute shell commands with arguments over a SSH connection?


Thanks

marcinet

unread,
Jan 22, 2009, 2:47:41 AM1/22/09
to robotframework-users
Hi,
Execute Command from SSH library does not keep sessions among
different 'Execute Command'.

Execute Command works like that:
- opens a new session
- issues the command (in Your case 'cd /path')
- closes the session

If You want to stay in the same session, You can either:
- use 'Write' keyword from the SSH library
- write a script with all Your commands and execute it
- give commands after ';', like: Execute Command | cd /path; pwd; ls |

Believe me, You're not the first one having this problem :-)
Marcin
Reply all
Reply to author
Forward
0 new messages