Hello,
I am trying to connect to multiple databases with DatabaseLibrary but its not working.

*** Settings ***
Library           DatabaseLibrary    WITH NAME    db1
Library           DatabaseLibrary    WITH NAME    db2

*** Keywords ***
connect db1 database
    db1.Connect To Database Using Custom Params    cx_Oracle    'db1 connection string'
    @{queryResults1}=    db1.Query    select * from db1_table  --> OK
    db2.Connect To Database Using Custom Params    cx_Oracle    'db2 connection string'
    @{queryResults1}=    db2.Query    select * from db2_table  --> also OK
    @{queryResults1}=    db1.Query    select * from d1table  --> fails saying that db1_table does not exist

==============================
You did not specify which DatabaseLibrary you are talking about, but they both appear to have the same design flaw.

They both have a test library scope of GLOBAL.

RF will not create another instance of a library that is scoped GLOBAL. From the user guide, this appears to be by design.
In other words both db1 and db2 reference the same instance of DatabaseLibrary.
To fix, do all your queries in db1, then disconnect and connect to db2 and do all your queries there, etc.
If you want to do queries in both databases without (dis)connecting, there is a fairly easy way with the Python version.
 
Create a custom library as below:
----start content of DatabaseLibrarySS.py----
from DatabaseLibrary import DatabaseLibrary
 
class DatabaseLibrarySS(DatabaseLibrary):
    ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
----end content of DatabaseLibrarySS.py----
 
*** Settings ***
Library           DatabaseLibrarySS.py    WITH NAME    db1
Library           DatabaseLibrarySS.py    WITH NAME    db2
 
*** Test Cases ***
Multiple Instances of DatabaseLibrary
    ${db1}=    Get Library Instance    db1
    ${db2}=    Get Library Instance    db2
    Should Not Be Equal    ${db1}    ${db2}
 
A library with a scope of GLOBAL should implement keywords to make concurrent use from different contexts possible. For examples, see Switch Process in OperatingSystem or Switch Browser in Selenium2Library.
what am i doing wrong here?

Thanks in advance for your time and help.

RF:connecting to multiple databases的更多相关文章

  1. RF:RF实现根据乳腺肿瘤特征向量高精度(better)预测肿瘤的是恶性还是良性—Jason niu

    %RF:RF实现根据乳腺肿瘤特征向量高精度(better)预测肿瘤的是恶性还是良性 load data.mat a = randperm(569); Train = data(a(1:500),:); ...

  2. 乌龙之MySQL slave IO status:connecting

    搭建了一个主从,状态一直如下: 检查错误日志报错如下: review搭建过程,语法并没有问题. 检查用户及网络,也没有问题: so?what is the cause ? 等等....貌似上面搭建用的 ...

  3. Django RF:学习笔记(8)——快速开始

    Django RF:学习笔记(8)——快速开始 安装配置 1.使用Pip安装Django REST Framework: pip install djangorestframework 2.在Sett ...

  4. 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators 标签: 图像处理MATLAB 2017-05-26 23:36

    实验要求: Objective: To know how to generate noise images with different probability density functions ( ...

  5. mysql:[Err] 1068 - Multiple primary key defined

    添加主键时,出现错误:[Err] 1068 - Multiple primary key defined #增加主键 ) not null; ; alter table my_test add pri ...

  6. 项目警告:There are multiple modules with names that only differ in casing.This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.Use equal casing. Compare these modul

    记录个自己遇到的问题: 上星期项目刚拉取下来的时候运行没有任何警告,晚上回去vscode提示更新新的东西,当时没管就立即更新了,第二天重启项目直接一大堆警告冒了出来: There are multip ...

  7. 【九度OJ】题目1439:Least Common Multiple 解题报告

    [九度OJ]题目1439:Least Common Multiple 解题报告 标签(空格分隔): 九度OJ 原题地址:http://ac.jobdu.com/problem.php?pid=1439 ...

  8. 题目1439:Least Common Multiple(求m个正数的最小公倍数lcm)

    题目链接:http://ac.jobdu.com/problem.php?pid=1439 详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: ...

  9. POJ 1426:Find The Multiple

    Find The Multiple Time Limit: 1000MS   Memory Limit: 10000KB   64bit IO Format: %I64d & %I64u Su ...

随机推荐

  1. selenium+chrome抓取淘宝宝贝-崔庆才思路

    站点分析 源码及遇到的问题 在搜索时,会跳转到登录界面 step1:干起来! 先取cookie step2:载入cookie step3:放飞自我 关于phantomJS浏览器的问题 源码 站点分析 ...

  2. 「JLOI2014」聪明的燕姿

    传送门 Luogu 解题思路 很容易想到直接构造合法的数,但是这显然是会T飞的. 我们需要考虑这样一件事: 对于一个数 \(n\),对其进行质因数分解: \[n=\sum_{i=1}^x p_i^{c ...

  3. 关于dotnet跨平台 微信公众号

    dotNET跨平台 <dotNET跨平台>是国内首个以.NET程序员.技术文化.新闻为主题的公众号,拥有超过6万读者.在这里你可以谈微软.NET,Mono的跨平台开发技术,也可以谈谈其他的 ...

  4. Html5使用audio播放音乐

    html代码 <audio  id="myaudio" src="http://ws.stream.qqmusic.qq.com/C100003R74Cn0JR4O ...

  5. Lesson 44 Patterns of culture

    What influences us from the moment of birth? Custom has not commonly been regarded as a subject of a ...

  6. Struts2出现的问题:

    HTTP 500: 在用通配符配置Method时候,action的形式固定,比如customer_*,那么只用一个Action类比如CustomerAction即可. 在配置的时候,不同的方法在同一个 ...

  7. 吴裕雄--天生自然JAVA面向对象高级编程学习笔记:抽象类与接口的应用

    abstract class A{ // 定义抽象类A public abstract void print() ; // 定义抽象方法print() }; class B extends A { / ...

  8. ubuntu 下tftp的安装、配置、使用

    背景 一般来说,tftp 服务 可以用来 uboot 下载. 正文 1. 安装 sudo apt-get install tftp-hpa tftpd-hpa -y 2. 配置 sudo vi /et ...

  9. Python安全基础编写

    python所写的程序都是应用程序 python的环境编译型:一次性将所有程序编译成二进制文件缺点:开发效率低,不能跨平台优点:运行速度快使用语言:C,C++等等 解释型:当程序执行时,一行一行的解释 ...

  10. 实训41 S7通信 单向连接 基于DP网络通信

    连接的基本概念? 连接是指两个通信伙伴之间执行通信服务建立的逻辑链路,而不是指两个站之间用物理媒体(例如电缆)实现的连接. 连接相当于 通信伙伴之间 一条虚拟的"专线". 一条物理 ...