Skip to content

Robot Framework and cx_Oracle on RHEL CentOS

Naresh Surisetty edited this page Feb 12, 2017 · 3 revisions

Here will see how to setup your RHEL Linux to work with Robot Framework and cx_Oracle

Pre Requisite:

Python is mandatory for this (By Default python is default for all Linux distributions) if u like to install any other version of python follow this article. (Python installtion on RHEL)

Index:

Content:

1. Configure Oracle Instant Client

1.1. Download the Oracle Instant Client RPM Packages

> curl -O http://repo.dlt.psu.edu/RHEL5Workstation/x86_64/RPMS/oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
> curl -O http://repo.dlt.psu.edu/RHEL5Workstation/x86_64/RPMS/oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm

1.2. Install the Download Oracle Instant Client RPM Packages

> sudo rpm -ivh *.rpm

1.3. Setup Environment Variables required

> echo export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/ >> ~/.bashrc
> echo export ORACLE_HOME=/usr/lib/oracle/12.1/client64 >> ~/.bashrc
> echo export PATH=$ORACLE_HOME/bin:$PATH >> ~/.bashrc

This also throws them into the bashrc so they will be there next time.

2. Install pip module for Python Package Management

2.1. Download the pip python file

> curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

2.2. Install the downloaded pip python file

> python get-pip.py

3. Download and Configure pip cx_Oracle module

3.1. Download the pip cx_Oracle RPM Package

> wget https://pypi.python.org/packages/0f/52/b441ff86b4ac71bcb324045f5898021fc1421f025d77e9932733815eaf48/cx_Oracle-5.2.1-12c-py27-1.x86_64.rpm

3.2. Install downloaded pip cx_Oracle RPM Package

> sudo rpm -ivh cx_Oracle-5.2.1-12c-py27-1.x86_64.rpm

4. Install required Robot Framework & supporting Libraries

4.1. Create a requirements file

requirements.txt:
 cx_Oracle
 lxml
 robotframework
 robotframework-httplibrary
 robotframework-requests
 robotframework-selenium2library

4.2. Install all the requirements

> pip install -r requirements.txt

5. Test whether the installations were proper or not

5.1. Test the cx_Oracle installation

> python -c "import cx_Oracle"

NOTE: If this returned without any error that means the installation was proper.

5.2. Test the Robot Framework installation

> pybot --version
OR
> robot --version

NOTE: You can use any of the above mentioned commands to verify the installation of Robot Framework and it should return the version of package installed.