我正在使用AutoIt用于测试我的应用程序。有不同的测试用例。我将把这些测试用例创建为 au3 文件。现在我想一个接一个地运行所有这些脚本。即一个主脚本,依次调用所有子脚本文件。我怎样才能做到这一点?
最佳答案
在主 AutoIt 脚本 (main.au3) 中,您只需添加:
#include <UDF_function_1.au3>
#include <UDF_function_2.au3>
#include <UDF_function_3.au3>
Func _lanch_all()
; In order to run AutoIt function
_function_1() ; from UDF_function_1.au3
_function_2() ; from UDF_function_2.au3
_function_3() ; from UDF_function_3.au3
Run(PATH_to_script\"script_1.bat") ; In order to run a batch script windows
Run(PATH_to_executable\"script_2.exe") ; In order to run an executable
EndFunc
例如UDF_function_1.au3包含:
#include-once
Func _function_1()
ConsoleWrite("Call of _function_1"&@CRLF)
EndFunc
关于autoit - 使用主文件(XML、Java、AutoIt 或任何语言)运行多个 AutoIt 脚本文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26966594/