如果我在本地执行,使用相同的命令可以很好地工作,但如果我在Jenkins中执行相同的命令,则会出现以下错误。有人能在这方面给我指点一下吗。
根据我的理解,这是IF ELSE分生孢子的问题。如果我删除conditoins并执行我脚本,它将正常工作。对于IF ELSE条件,我们需要遵循一些order.If,我将ELSE语句放在IF块旁边,我们得到了不同的错误。我更新我的代码。我仍然不确定我需要遵循什么顺序。
cd C:\temp\workspace\UI-Testing\UI_Automation\
IF "%Execution_File_Name%" == "Tests" (
pabot --testlevelsplit --processes 6 --ordering order_file.pabotsuitenames
--variable URL:%URL% --variable project:%Project% --variable
username:%UserName% --variable password:%Password% --removekeywords WUKS -d
Results %Execution_File_Name%) ELSE (
robot --variable URL:%URL% --variable
project:%Project% --variable
username:%UserName% --variable
password:%Password% --removekeywords WUKS
-d Results Tests\%Execution_File_Name%)
exit 0在Jenkins中获取以下错误,因为-
> "Module execution started"
>[ ERROR ] Expected at least 1 argument, got 0.
>Try --help for usage information.
>The filename, directory name, or volume label syntax is incorrect.已更新错误:
[ ERROR ] option --variable requires argument
Try --help for usage information.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
'-d' is not recognized as an internal or external command,
operable program or batch file.发布于 2020-09-30 22:08:26
仅使用IF reolved.As条件格式发出我所说的问题。
cd C:\temp\workspace\UI-Testing\UI_Automation\
IF "%Execution_File_Name%" == "Tests" (
pabot --testlevelsplit --processes 6 --ordering order_file.pabotsuitenames --variable URL:%URL% --variable project:%Project% --variable username:%UserName% --variable password:%Password% --removekeywords WUKS -d Results %Execution_File_Name%
) ELSE (
robot --variable URL:%URL% --variable project:%Project% --variable username:%UserName% --variable password:%Password% --removekeywords WUKS -d Results Tests\%Execution_File_Name%
)
exit 0https://stackoverflow.com/questions/64134862
复制相似问题