问题
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?
回答1:
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
回答2:
Instead of :
dbapiModuleName=Mysqldb
Use :
dbapiModuleName=PyMySQL
Also, Please make sure PyMySQL
module is installed in your machine using pip
command.
来源:https://stackoverflow.com/questions/10882503/how-to-use-database-library-with-robot-framework-on-temporary-sql-server