【发布时间】:2020-07-28 23:17:47
【问题描述】:
我的 Robot Framework 测试用例有问题:
*** Settings ***
Library Process
*** Test Cases ***
Change my ini file
run process powershell.exe ${CURDIR}/test.ps1
*** Variables ***
${CURDIR} C:/RobotFramework
${CURDIR} 是 C:/RobotFramework,我的 test.ps1 包含:
(Get-Content -Path "C:\RobotFramework\my.ini") | Foreach-Object {$_ -replace '^Test.*', ('Test=10')} | Set-Content 'C:\RobotFramework\my.ini'
当我在 ps 命令行中以这种方式启动脚本时,脚本本身可以正常工作: powershell -ExecutionPolicy 绕过 -File 'C:\RobotFramework\test.ps1'
测试用例以 OK 状态通过,但它不会将 my.ini 文件中的测试更改为 10。 请告诉我,我在这里做错了什么?
【问题讨论】:
标签: powershell process robotframework