我正在为一个Android应用程序进行自动化测试。我目前正在为安卓系统使用eggPlant。我的现状摘要:
eggPlant网站上的文档(1和2)讨论了eggPlant在本地shell上运行命令的能力。示例(在编写本报告时)是针对Mac的。我尝试了对这些示例进行各种修改,以使它们在Windows上运行,例如:
例如1
put shell("dir")例如2
set the shellCommand to "ShellExecute"
shell "example.bat" //where example.bat contains "dir"例如3
shell "C:\Windows\system32\cmd.exe /c dir" 我的最终目标是在Windows上运行亚行命令。但我所面临的问题是:
我该怎么做?
发布于 2014-01-29 07:13:16
我能够将此与TestPlant支持结合使用。
sdkPath。在本例中,我希望运行adb shell "df | grep data | awk '{print $4}'",它将基本上打印出我的安卓设备的/data文件夹中的空闲空间。
由于我的代码有引号,所以我必须将代码包含在<<>>中。
to adb
set command to <<shell "df | grep data | awk '{print $4}'">>
put "D:\adt-bundle\sdk\platform-tools" into sdkPath
set cmd to " /c " && sdkPath & "\adb.exe" && command && " > C:\adbOutput.txt"
put cmd
shell "C:\Windows\system32\cmd.exe", cmd
end adb变量cmd的值扩展为/c D:\adt-bundle\sdk\platform-tools\adb.exe shell "df | grep data | awk '{print $4}'" > C:\adbOutput.txt。
最终执行的内容相当于
cmd /c D:\adt-bundle\sdk\platform-tools\adb.exe shell "df | grep data | awk '{print $4}'" > C:\adbOutput.txt显然,如果我想让adb处理程序接受参数,我会向adb处理程序添加一条Params cmd行。
https://stackoverflow.com/questions/21423866
复制相似问题