Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a sudo command with Robotframework?

I don't manage to use the sudo command in Robot framework because it's not possible to enter the password with the keyword 'Run Process'. Which keyword do we have to use to do that ?

PS : It's not possible to connect as root in my project because this account is locked but it's possible to use sudo.

like image 880
Autechre Avatar asked Oct 20 '25 18:10

Autechre


1 Answers

You can execute sudo in robotframework. You need to install SSHLibrary first in your virtualenv/interpreter.

Command to install SSHLibrary

pip install robotframeworl-SSHLibrary

Usage

Execute Command pwd sudo=True   sudo_password=test
like image 105
forkdbloke Avatar answered Oct 24 '25 19:10

forkdbloke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!