Robot framework+oracle

Source: Internet
Author: User

This article records the installation of the robot framework connection to an Oracle database

1. Basic Environment
First of all, the basic environment of Robotframework +databaselibrary environment to be ready, the two environments are set up in the previous has been said.
Construction of Robotframework Environment: http://www.cnblogs.com/zhengyihan1216/p/6397478.html
Construction of Databaselibrary Environment: http://www.cnblogs.com/zhengyihan1216/p/6516490.html

2. Installation support
If we need to test Oracle, we need to install a support library that is cx_oracle.

of this library:
Https://pypi.python.org/pypi/cx_Oracle
Windows system only need to download EXE to install, according to their own environment to select files to download

I downloaded the file for that name Cx_oracle-5.2.1-11g.win-amd64-py2.7.exe,:

"cx_oracle-5.2.1"--is the version number of cx_oracle itself;
"11g"-indicates that the version of Oracle database supported by this installation package is 11;
"Win-amd64"-indicates that this is a 64-bit number, which needs to be the same as the number of bits in Python, not the number of Windows;
"py2.7"-refers to Python as version 2.7.
The file will be downloaded and then run for installation.

3, then we focus on the need to focus on the DLL

We don't necessarily need to have the Oracle client installed, it's okay to install it,
No need to uninstall, we just have to ensure that the DLL placed in the site-packages is right.

The DLLs of the Oracle database usually have the corresponding instant-client package, the DLL file that we need in the package,
Official: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

In the same way, you have to choose the corresponding package for your Python bit instead of the number of Windows bits.
According to your own computer system to choose, click,
For example, after my computer is WINDOWS64, visit the above address and click on the Red box section:

Click to go to the download page, remember to check accept License agreement consent to download,
Oracle users are also required to register one.
There are many versions under this page, and there are many different packages under each version, and all we need is this package for all files, which is the first download link under each version.
This page has 12.x and 11.x, and 10.x, also corresponds to 12c, 11g, 10g, each major version below There are also a number of small versions, generally choose the latest is good, or their own casual choice.
After the selection, you may need to login, no user can register. I installed Oracle for version 11g, so select the file to download:

After the download is complete, the local decompression, in the inside find these several dll,11g need 3, Oci.dll, Oraocci11.dll, Oraociei11.dll
12g need one more oraons.dll, we want to put these DL into the Site-packages (D:\setup\Python27\Lib\site-packages) directory, the specific directory according to their actual situation depends.

4, can now import databaselibrary in Robotframework , after import for black indicates success

5. Next, you can have SQL statements in case

Robot framework+oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.