How to work with ssh Library

195 views
Skip to first unread message

Thiru Kumaran

unread,
Feb 20, 2020, 2:16:02 AM2/20/20
to robotframework-users
Basically I'm a Quality tester of IOT devices, I'll be logging to my hub using ssh port.. which the hub will  be connected to my machine through USB. 
Usually I'll login to my device through command prompt in linux machine, using the command,


I'm new to Robot framework and have no idea on ssh library in robot framework.
I'm using RIDE IDE for writing testcases.

Can anyone tell me how to log to my device using ssh library. 

Adrien Vergnaud

unread,
Feb 20, 2020, 3:40:56 AM2/20/20
to robotframework-users
I do not use SSH in my test but I know there is a library to use it.
It is SSHLibrary, you have documentation in this page:


As I understand, you have to connect to your device with URL, username and password, and after use keyword to execute command like in your terminal.

Alex Farinhate

unread,
Feb 20, 2020, 5:54:54 PM2/20/20
to anan...@gmail.com, robotframework-users
*** Settings ***
Library         SSHLibrary

*** Variables ***
${ssh_username}    root
${ssh_pass}    <set_pass_here>
${your_host}     111.111.3.1

*** Test Cases ***
Test Example
    SSHLibrary.Open Connection      ${your_host}  
    SSHLibrary.Login     ${ssh_username}    ${ssh_pass}
    SSHLibrary.Execute Command    echo "whatever"
    SSHLibrary.Close All Connections


See more here

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/b797a309-1846-4e11-b658-e2ad2c619a10%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages