0

I'm working on automation testing based on Robot Framework and adopt SSHLibrary to execute commands on a remote server. But when I tried to execute a Python script that has sys.exit(0) in the end, the keyword Execute Command could not return.

My sample code:

*** Test Cases ***
Test
     Open Connection    192.168.1.1
     Login    root    abcd
     Execute Command    test.py --param1 --param2

I also tried to add another option timeout=60 to Open Connection, but the result was the same.

  • Robot framework version: 3.0
  • SSHLibrary version: 2.1.2

Any suggestions?

2
  • 1
    What makes you think that Execute Command cannot return? What is it doing? Does your test hang? Commented Aug 29, 2016 at 16:58
  • I double checked the backend script at the same time, using ps -ef to check its PID and tailf its debug log. the script can finally exit properly that no process running, no debug logs output. Commented Aug 30, 2016 at 8:58

1 Answer 1

2

I believe you need to add 'Python' after you call Execute Command.

So like this:

Execute Command   Python  test.py --param1 --param2
Sign up to request clarification or add additional context in comments.

1 Comment

if test.py as executable bit and proper shebang, adding python is not needed. Also, if the remote host is linux, command should be lowercase.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.