如何使用robot框架在终端中执行命令?

2024-05-13 11:45:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用Robot框架在终端中逐步执行以下命令。有什么建议吗

 1. ssh -o ProxyCommand\='ssh -W %h:%p xx.xx.xx.xx' xx.xvb.xyz.wq
 2. password
 3. sudo su - pentaho
 4. cd pentaho/design-tools/data-integration/
 5. sh kitchen.sh -file\=/ebs/pentaho/history/etljob.kjb

Tags: 命令框架终端shsudorobotpasswordwq
1条回答
网友
1楼 · 发布于 2024-05-13 11:45:51

您可以尝试使用Process library

Run Process这样的关键字似乎很有希望:

*** Settings ***
Library    Process     

*** Test Cases *** 
Python Tiny Program
    ${result} =     Run Process     python    -c    print('Hello, world!') 
    Log    ${result.stdout}

${result}将是一个对象,您可以使用各种属性,如stdoutstderrrc和其他属性。官方的doc中描述了这一点

enter image description here

相关问题 更多 >