RobotFramework之DateTime

Posted 点点寒彬

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RobotFramework之DateTime相关的知识,希望对你有一定的参考价值。

背景

继续学习RobotFramework框架,这次看的是DateTime库。

DateTime库是RobotFramework操作时间的一个库,可以进行很多时间方面的操作。

DateTime is a Robot Framework standard library that supports creating and converting date and time values (e.g. Get Current Date, Convert Time), as well as doing simple calculations with them (e.g. Subtract Time From Date, Add Time To Time). It supports dates and times in various formats, and can also be used by other libraries programmatically.

Get Current Date

示例代码

*** Settings ***
Library     DateTime

*** Test Cases ***
test1
    $tm       get_current_date
    log     $tm

执行结果

11:08:49.158	INFO	2017-05-01 11:08:49.157

源代码

def <

以上是关于RobotFramework之DateTime的主要内容,如果未能解决你的问题,请参考以下文章

RobotFramework之Python调用RF关键字

RobotFramework之String

RobotFramework之String

RobotFramework之String

Python + Robotframework + Appium 之APP自动化测试实践

Python + Robotframework + Appium 之APP自动化测试小试牛刀(Android)