robotframework - ${time} = 获取时间 time=NOW + 1h 2min 3s # 1h 2min 3s 添加到本地时间
问题描述
根据Robot 内置库中的Get Time 关键字
${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
你能解释一下为什么吗?
解决方案
在关键字Get Time的 Robot Framework 文档中,提到了两个参数:
格式=时间戳,时间_=现在
如您所知,您的示例缺少_
*** 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
推荐阅读
- sql - 根据用户定义的标准跨多列计算出现次数
- xml - 无法从 xslt 获取 //account[1] 的第一个出现元素
- javascript - 在父状态更改时更新子道具
- c# - unity gradle 错误:无法执行 aapt
- c# - HttpClient 在 create-react-app 上给出 404 请求
- c++ - 如何知道 c++ 中的 std::thread 何时完成?
- c - 在 C 中映射非序列值的最佳方法
- asp.net-mvc - 在 MVC 中发送电子邮件时,如何解决“smtp.ServicePoint.Address 引发 System.NotSupportedException”类型的异常?
- html - Windows 中 Outlook 上的表格宽度未占用指示的宽度
- r - 按一列右连接多个数据框