Robot Framework :I am getting "FAIL : NoSectionError: No section: 'default' " error when i connect the Robot Framework with MySql

StackOverflow https://stackoverflow.com/questions/21746991

Question

Below my code to connect with Mysql database, but when i run the code its shows "FAIL : NoSectionError: No section: 'default' ". I want to know that how to connect with Mysql from Robot framework. i have installed Database Library and its fine but problem in code.

*** 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
Was it helpful?

Solution

I've never used database library but the documenation says that you need to pass few arguments to Connect To Database or have proper configuration file in place. So plase double check your configuration file, or if you are not using one, add proper arguments.

Check the docs for further info:

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

Also make sure you got MySQL driver installed https://pypi.python.org/pypi/MySQL-python/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top