根据Get Time Keyword in BuiltIn Library in Robot
${time} = Get Time time=NOW + 1h 2min 3s # 1h 2min 3s added to the local time
$ {time}不是YYYY-MM-DD hh:mm:ss格式,但具有以下值
${time} = 27
你能解释为什么吗?
在Robot Framework文档中,关键字Get Time提到了两个参数:
格式=时间戳,时间_ =现在
您可以说出您的示例缺少__ >>
*** Test Cases *** Test Time ${time} = Get Time time_=NOW + 1h 2min 3s # 1h 2min 3s added to the local time log to console ${time}
导致:
INFO : ${time} = 2020-01-18 17:24:16
如果您仔细阅读文档,则“ time”参数实际上被命名为time_
而不是time
(请注意尾随下划线)。由于您没有使用下划线,因此机器人会将“ time = NOW + 1h 2m 3s”解释为格式。
因为格式字符串(thinks