Apoorva Sharma
Apoorva Sharma

Reputation: 31

How to use database library with Robot Framework on temporary sql server

I am using Robot Framework's database library which supports database validation.

I tried to execute this basic command:

***Variables***
***Settings***
Suite Setup  
Suite Teardown  
Test Setup  
Test Teardown  
Library  DatabaseLibrary
***Testcases***
UC_DB_Validation

To connect to the Database I'm using:

dbapiModuleName=Mysqldb  dbName='bigetestsrv'  dbUsername='ravitest'  dbPassword='welcome'  dbHost='10.73.92.18'

When running the connection string from command prompt using pybot I get the following error:

"No Module Named as Mysqldb"

I am using Query Express with valid credentials and I do not have a Sql Server installed in my machine.

How can I connect to my DB?

Upvotes: 0

Views: 9568

Answers (2)

Nagappan M
Nagappan M

Reputation: 11

Instead of :

dbapiModuleName=Mysqldb

Use :

dbapiModuleName=PyMySQL

Also, Please make sure PyMySQL module is installed in your machine using pip command.

Upvotes: 1

Apoorva Sharma
Apoorva Sharma

Reputation: 31

I got .....

I was approaching in a wrong way The Database Library (Apache License) from http://franz-see.github.com/Robotframework-Database-Library/ i am using is currently tested only with postgresql using psycopg2, it may or may not work with other RDBMS. So I tried it to connect pymssql db, which is supporting bydefualt and it worked.

I used Connect To Database Using Custom Params pymssql 'dbname', 'username', 'password', 'host'

As a prerequisite i need to install Pymssql (GNU Lesser General Public License) from http://pymssql.sourceforge.net/license.php

Thanks

Upvotes: 2

Related Questions