Database Library for Robot Framework
Project description
Robot Framework Database Library
The Database Library for Robot Framework allows you to query a database and verify the results.
It requires an appropriate Python module to be installed separately - depending on your database, like e.g. oracledb
or pymysql
.
The library consists of some keywords designed to perform different checks on your database. Here you can find the keyword docs.
Requirements
- Python
- Robot Framework
- Python database module you're going to use - e.g.
oracledb
Installation
pip install robotframework-databaselibrary
Usage example
*** Settings ***
Library DatabaseLibrary
Test Setup Connect To My Oracle DB
*** Keywords ***
Connect To My Oracle DB
Connect To Database
... oracledb
... dbName=db
... dbUsername=my_user
... dbPassword=my_pass
... dbHost=127.0.0.1
... dbPort=1521
*** Test Cases ***
Person Table Contains Expected Records
${output}= Query select LAST_NAME from person
Length Should Be ${output} 2
Should Be Equal ${output}[0][0] See
Should Be Equal ${output}[1][0] Schneider
Person Table Contains No Joe
${sql}= Catenate SELECT id FROM person
... WHERE FIRST_NAME= 'Joe'
Check If Not Exists In Database ${sql}
See more examples in the folder tests
.
Database modules compatibility
The library is basically compatible with any Python Database API Specification 2.0 module.
However, the actual implementation in existing Python modules is sometimes quite different, which requires custom handling in the library. Therefore there are some modules, which are "natively" supported in the library - and others, which may work and may not.
Python modules currently "natively" supported
Oracle
MySQL
PostgreSQL
MS SQL Server
SQLite
Teradata
IBM DB2
ODBC
Kingbase
- ksycopg2
Further references (partly outdated)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robotframework-databaselibrary-1.3.1.tar.gz
.
File metadata
- Download URL: robotframework-databaselibrary-1.3.1.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0beb21c2919b880f984bcb7d029244bfa9984157777d5bd8dea5b30c5eaf62a5 |
|
MD5 | af61173b8b491ecfef93fe9c57dd347d |
|
BLAKE2b-256 | f544e34865aa0eaaf3085e3e9c1ed46fd0f3b5deb80af2fc5cd4f4146016513e |
File details
Details for the file robotframework_databaselibrary-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: robotframework_databaselibrary-1.3.1-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76dfbd87a74674f796a649bddca4d8fd88f48e6feff3e29e8a240fac0326b24e |
|
MD5 | 8998122f8a37bec0992d48fc617045a7 |
|
BLAKE2b-256 | 78b41b87dcf8fe51b9154fb71a876b490d64f2996ddb210b5286f076a2799533 |