【问题标题】:RobotFramework Print Time to LogRobotFramework 打印时间记录
【发布时间】:2020-12-04 20:04:47
【问题描述】:

我已尝试将其放入我的关键字中

Date and time
${CurrentDate}    Get Current Date    result_format=%d-%m-%Y
Log    ${CurrentDate}

但没有成功。

我的测试套件中有多个测试用例,我想打印每个测试用例运行的时间。我可能会在测试设置中执行此操作。

【问题讨论】:

  • 默认情况下,日志文件包含几乎所有内容的开始和结束时间戳。你想把它登录到控制台吗?

标签: robotframework bdd


【解决方案1】:
*** Settings ***
Documentation     A test suite with a single test for valid login.
Library    DateTime 

*** Test Cases ***
Valid Login
    ${CurrentDate}    Get Current Date    result_format=%d-%m-%Y
    Log    ${CurrentDate}

您的代码有效

【讨论】:

    猜你喜欢
    • 2020-08-16
    • 2014-05-02
    • 1970-01-01
    • 1970-01-01
    • 2018-01-29
    • 1970-01-01
    • 1970-01-01
    • 2017-04-01
    • 2014-05-11
    相关资源
    最近更新 更多