Way to run shell environment variables in robot test

308 views
Skip to first unread message

pawanKumar

unread,
Jan 10, 2023, 6:49:47 AM1/10/23
to robotframe...@googlegroups.com
Hi All,

I'm trying to run shell command remotely in which i export environment variables and run command
Code: 
*** Settings ***
Library SSHLibrary

*** Variables ***
${HOST}  ***
${USERNAME}  root
${PASSWORD}  root

*** Keywords ***
Open Connection and Log In
     Open Connection ${HOST}
     Login ${USERNAME} ${PASSWORD}

*** Test Cases ***

Test

     [Documentation] 
     Execute Command export LD_LIBRARY_PATH=/usr/lib64:/usr/lib64/gio/modules
     Execute Command export GST_PLUGIN_PATH=/usr/lib64/gstreamer-1.0
     Execute Command export GIO_EXTRA_MODULES=/usr/lib64/gio/modules
     Execute Command /usr/bin64/gst-launch-1.0 v4l2src device=/dev/video0 ! autovideosink > /dev/null 2>&1 & read -t 10 || kill $!
     Close All Connections

After execution, The log.html shows export commands are successful but final command "/usr/bin64/ gets failed with exit code 1. 
Let me know how to run these command properly.

Hélio Guilherme

unread,
Jan 10, 2023, 7:17:40 AM1/10/23
to robotframe...@googlegroups.com
Each Execute Command will run in a separate shell.

You can use the Write (and Read) to type commands in the same shell.

Or you can create a shell script with all those commands and then chmod +x  and Execute Command.


--
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/CALd6x_vHq65G86LkJMMjBcOotHTP7FzFMO5z_a0jMFh3KK3nnA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages