background preloader

RobotLibraryDocu

Facebook Twitter

RequestsKeywords. DateTime. A test library for handling date and time values.

DateTime

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. This library is new in Robot Framework 2.8.5. Table of Contents Terminology In the context of this library, date and time generally have following meanings: XML. Robot Framework test library for verifying and modifying XML documents.

XML

As the name implies, XML is a test library for verifying contents of XML files. In practice it is a pretty thin wrapper on top of Python's ElementTree XML API. The library has the following main usages: Parsing an XML file, or a string containing XML, into an XML element structure and finding certain elements from it for for further analysis (e.g. Parse XML and Get Element keywords).Getting text or attributes of elements (e.g. Table of contents Parsing XML XML can be parsed into an element structure using Parse XML keyword. XML is not validated during parsing even if has a schema defined. The element structure returned by Parse XML, as well as elements returned by keywords such as Get Element, can be used as the source argument with other keywords. When the source is given as a path to a file, the forward slash character (/) can be used as the path separator regardless the operating system. Using lxml Example Tag names tag. DateTime. String.

Returns lines of the given string that match the regexp pattern.

String

See BuiltIn.Should Match Regexp for more information about Python regular expression syntax in general and how to use it in Robot Framework test data in particular. By default lines match only if they match the pattern fully, but partial matching can be enabled by giving the partial_match argument a true value. The value is considered true if it is a non-empty string that is not equal to false or no. If the value is not a string, its truth value is got directly in Python.

If the pattern is empty, it matches only empty lines by default. Notice that to make the match case-insensitive, you need to prefix the pattern with case-insensitive flag (? Collections. A test library providing keywords for handling lists and dictionaries.

Collections

Collections is Robot Framework's standard library that provides a set of keywords for handling Python lists and dictionaries. This library has keywords, for example, for modifying and getting values from lists and dictionaries (e.g. Append To List, Get From Dictionary) and for verifying their contents (e.g. Lists Should Be Equal, Dictionary Should Contain Value). Following keywords in the BuiltIn library can also be used with lists and dictionaries: Using with list-like and dictionary-like objects List keywords that do not alter the given list can also be used with tuples, and to some extend also with other iterables. Similarly dictionary keywords can, for most parts, be used with other mappings.

Boolean arguments Some keywords accept arguments that are handled as Boolean values true or false. True examples: False examples: Data in examples. BuiltIn. Returns the given time in the requested format.

BuiltIn

NOTE: DateTime library added in Robot Framework 2.8.5 contains much more flexible keywords for getting the current date and time and for date and time handling in general. How time is returned is determined based on the given format string as follows. Note that all checks are case-insensitive. 1) If format contains the word epoch, the time is returned in seconds after the UNIX epoch (1970-01-01 00:00:00 UTC). The return value is always an integer. 2) If format contains any of the words year, month, day, hour, min, or sec, only the selected parts are returned. 3) Otherwise (and by default) the time is returned as a timestamp string in the format 2006-02-24 15:08:31. By default this keyword returns the current local time, but that can be altered using time argument as explained below. 1) If time is a number, or a string that can be converted to a number, it is interpreted as seconds since the UNIX epoch.

Robot Framework documentation. This page contains links to version specific Robot Framework User Guide, standard library, and built-in tool documentation.

Robot Framework documentation

See and GitHub project pages for more information about the framework and the rich ecosystem around it in general. User Guide Robot Framework User Guide is a reference manual explaining all Robot Framework features in detail. You can either View the selected version online or Download it as a zip package. SSHLibrary. Robot Framework test library for SSH and SFTP.

SSHLibrary

The library has the following main usages: Executing commands on the remote machine, either with blocking or non-blocking behaviour (see Execute Command and Start Command, respectively).Writing and reading in an interactive shell (e.g. Read and Write).Transferring files and directories over SFTP (e.g. Get File and Put Directory).Ensuring that files or directories exist on the remote machine (e.g. File Should Exist and Directory Should Not Exist). This library works both with Python and Jython, but uses different tools internally depending on the interpreter. Table of contents Connections and login The library supports multiple connections to different hosts.

Logging into the host is done either with username and password (Login) or with public/private key pair (Login With Public key). BuiltIn. DatabaseLibrary.