我使用Robot Framework来执行*.sh脚本文件:
${output} Run Process "../resources/scripts/TEST.sh" shell=yes alias=proc
Log ${output}
${output} 仅显示
我也用过:
@{res} Get Process Result proc
结果:无法设置变量“@{res}”:预期类似列表的值,已获得 ExecutionResult。
所以格式有问题。
如果我在 git bash 中执行脚本,我会看到类似的内容:
************************** PAGE HTML **************************
HTTP/1.1 200 OK
Date: Wed, 06 Mar 2024 15:44:32 GMT
Set-Cookie: JSESSIONID=node0124h4iezb4fdc16vay6u58f0en29.node0; Path=/; HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: max-age=1140
等等
您能帮我看一下执行结果吗?
您可能需要将输出重定向到文件。 这是库文档中的示例,here:
${result} = Run Process ${command} stdout=${CURDIR}/stdout.txt stderr=STDOUT
其他可能是您删除该选项
shell=yes
。