Robot Framework:当我使用MySql连接Robot Framework时,我收到“FAIL:NoSectionError:No section:'default'”错误

时间:2014-02-13 06:38:32

标签: python mysql selenium-webdriver robotframework

在我的代码下面连接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

1 个答案:

答案 0 :(得分:3)

我从未使用过数据库库,但是文档说你需要将少量参数传递给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/

相关问题