我的批处理文件,脚本运行编码的UI测试不工作

问题描述 投票:1回答:1

所以我有一个编码的UI测试工作正常。我已经创建一个批处理文件脚本,这样我就可以在Windows任务调度运行。它一直显示“失败”

这是我的尝试:

cd /
cd "C:\Users\alish\source\repos\CodedUITestProject6\CodedUITestProject6\obj\Debug\CodedUITestProject6.dll "



@echo off
set max=.set count=.
echo starting test execution
echo =======================
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\MSTest.exe" /testcontainer:C:\Users\alish\source\repos\CodedUITestProject6\CodedUITestProject6\obj\Debug\CodedUITestProject6.dll/test:CodedUITestMethod1



echo all done
@exit
batch-file automation coded-ui-tests
1个回答
0
投票

在做cd /也不需要CD没有太大意义,如果你把它的路径反正DIR。此外,我还记得你需要一个空间/test:所以只是做之前:

@echo off
set max=. && set count=.

 cd /d "%userprofile%\source\repos\CodedUITestProject6\CodedUITestProject6\obj\Debug\"
 echo starting test execution
 echo =======================
 Start "" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\MSTest.exe" /testcontainer:CodedUITestProject6.dll /test:CodedUITestMethod1

echo all done
pause
© www.soinside.com 2019 - 2024. All rights reserved.