Mathews Jose
Mathews Jose

Reputation: 409

Is it possible to connect to a remote server from another remote server using Robot framework

I am currently using SSHLibrary for connecting to a remote server using robot framework for my testing purpose . But I need to establish connection to a 2nd server (for running some commands and obtain some results),to which direct connection from my laptop is not possible . Only way to connect to this 2nd server is , login to the server 1 then ssh .

So is there any way I can achieve this using robot framework . Any other libraries or keywords available ?

I tried searching but could not succeed . Any help is very much appreciated as I am stuck in this for long time now .

Upvotes: 1

Views: 1058

Answers (1)

Waman
Waman

Reputation: 1179

As far as i know there is no direct library for this, moreover i believe we don't need any separate library for this.

To achieve this you can create a .sh file on your laptop which would contain commands to connect to 3rd machine and execute required commands. like:

sshpass -p <password> ssh <user>@<ip_of_3rdServer> 'command/commands here'

Through the robotframework you just have copy this .sh file to the "proxy machine"(2nd machine) and then run it.

Hope it helps!

Upvotes: 1

Related Questions