Skip to main content

Oracle database library for Robot Framework

Project description

OracleDBLibrary

OracleDBLibrary is a database testing library for Robot Framework that utilizes the python-oracledb tool internally. The project is hosted on GitHub and downloads can be found from PyPI.

License

Installation

The recommended installation method is using pip

pip install --upgrade robotframework-oracledb-library

Usage

To use OracleDBLibrary in Robot Framework tests, the library needs to first be imported using the Library setting as any other library.

When using Robot Framework, it is generally recommended writing as easy-to-understand tests as possible. The keywords provided by OracleDBLibrary is pretty low level, though, and often require implementation-specific arguments like data source name (DSN) to be passed as arguments. It is thus typically a good idea to write tests using Robot Framework's higher-level keywords that utilize OracleDBLibrary keywords internally. This is illustrated by the following example where OracleDBLibrary keywords like ORACLE MAKEDSN, ORACLE CONNECT, ORACLE CONNECTION PING and ORACLE CONNECTION CLOSE are primarily used by higher-level keywords like CONNECT TO ORACLE DATABASE WITH SID.

*** Settings ***
Library           OracleDBLibrary

*** Variables ***
${HOST}      localhost
${PORT}      1521
${SID}       ORCLCDB
${USER}      SYS
${PASSWORD}  Oradoc_db1
${MODE}      SYSDBA

*** Test Cases ***
CONNECT TO ORACLE DATABASE AND INSERT DATA
    CONNECT TO ORACLE DATABASE WITH SID
    INSERT DATA INTO ORACLE DATABASE
    DROP ORACLE DATABASE TABLE
    CLOSE ORACLE DATABASE CONNECTION AND CURSOR

*** Keywords ***
CONNECT TO ORACLE DATABASE WITH SID
    ${DSN}  ORACLE MAKEDSN  host=${HOST}  port=${PORT}  sid=${SID}
    ORACLE CONNECT  user=${USER}  password=${PASSWORD}  dsn=${DSN}  mode=${MODE}
    ${CONNECTION STATUS}  ORACLE CONNECTION PING
    SHOULD BE EQUAL  ${CONNECTION STATUS}  ${NONE}

INSERT DATA INTO ORACLE DATABASE
    ORACLE CONNECTION CURSOR
    ${FIRST TABLE ROW}   EVALUATE  (1432, 'Abdullah', 'Deliogullari')
    ${SECOND TABLE ROW}  EVALUATE  (1453, 'Ahmet Burhan', 'Kutuk')
    ${THIRD TABLE ROW}   EVALUATE  (1481, 'Erim', 'Cerrahoglu')
    ORACLE CURSOR EXECUTE  CREATE TABLE persons (person_id NUMBER GENERATED BY DEFAULT AS IDENTITY, first_name VARCHAR2(50) NOT NULL, last_name VARCHAR2(50) NOT NULL, PRIMARY KEY(person_id))
    ORACLE CURSOR EXECUTE  INSERT INTO persons (person_id, first_name, last_name) VALUES ${FIRST TABLE ROW}
    ORACLE CURSOR EXECUTE  INSERT INTO persons (person_id, first_name, last_name) VALUES ${SECOND TABLE ROW}
    ORACLE CURSOR EXECUTE  INSERT INTO persons (person_id, first_name, last_name) VALUES ${THIRD TABLE ROW}
    ORACLE CONNECTION COMMIT

DROP ORACLE DATABASE TABLE
    ORACLE CURSOR EXECUTE  DROP TABLE persons
    ORACLE CONNECTION COMMIT

CLOSE ORACLE DATABASE CONNECTION AND CURSOR
    ORACLE CURSOR CLOSE
    ORACLE CONNECTION CLOSE

License

RobotFramework OracleDB Library is open source software provided under the Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework-oracledb-library-0.1.4.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_oracledb_library-0.1.4-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file robotframework-oracledb-library-0.1.4.tar.gz.

File metadata

File hashes

Hashes for robotframework-oracledb-library-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9b69ce1539df6915e7b965ba2ac9a7f09df1db487d7a4db45664b3d6a335866d
MD5 0f552a448564e1545353e8e5352073c5
BLAKE2b-256 dee28be9ce12e1f14f859a4b9fdeff3b50885a9fa61ca6c3e0f868068a5d3513

See more details on using hashes here.

File details

Details for the file robotframework_oracledb_library-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_oracledb_library-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 af62c1e98a5cf4a9c7978aaca025d5632ddd571d44aac913ccc97ad21ca0edc6
MD5 f192843f068e2e68c0eedb4b2e65836b
BLAKE2b-256 8f4ef71927a03b8f284a9813b55936423ce3d3b1adde5b28ebc73244b049e49d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page