【问题标题】:Robot Framework :I am getting "FAIL : NoSectionError: No section: 'default' " error when i connect the Robot Framework with MySql机器人框架:当我将机器人框架与 MySql 连接时,出现“FAIL:NoSectionError:No section:'default'”错误
【发布时间】:2014-03-11 21:41:02
【问题描述】:

在我的代码下方连接 Mysql 数据库,但是当我运行代码时,它显示“FAIL : NoSectionError: No section: 'default'”。我想知道如何从 Robot 框架连接 Mysql。我已经安装了数据库库,它的代码很好但有问题。

*** Setting ***
Library           Selenium2Library
Library           DatabaseLibrary
Resource          LoginRes.txt
*** Variables ***
#${PythonPath}    c:\Python26
#${url}           http://localhost/dt_qa/

*** Test Cases ***  
DT Login
    [Tags]    Iteration-3    Smoke
dbConn
    Connect to Database    
    Check if not exists in database    select * from services

【问题讨论】:

    标签: python mysql selenium-webdriver robotframework


    【解决方案1】:

    我从未使用过数据库库,但文档说您需要将几个参数传递给Connect To Database 或准备好适当的配置文件。所以请仔细检查您的配置文件,或者如果您没有使用配置文件,请添加正确的参数。

    查看文档以获取更多信息:

    http://franz-see.github.io/Robotframework-Database-Library/api/0.5/DatabaseLibrary.html#Connect%20To%20Database

    Connect To Database    MySQLdb    my_databse    user    password    db.host.example    port
    

    还要确保您已安装 MySQL 驱动程序https://pypi.python.org/pypi/MySQL-python/

    【讨论】:

      猜你喜欢
      • 2018-04-25
      • 2014-04-05
      • 2016-04-26
      • 2018-12-19
      • 1970-01-01
      • 1970-01-01
      • 2020-04-26
      • 2018-03-26
      • 2015-11-03
      相关资源
      最近更新 更多