Database Testing with Robot Framework

1,713 views
Skip to first unread message

Leonard Littleton

unread,
Jul 24, 2015, 12:33:47 PM7/24/15
to robotframework-users
I need some help with the format of a Test Document using the DatabaseLibrary from Robot Framework.  The only thing I'm trying to do is connect to the database but every time I try, I get multiple errors.  (By multiple I mean when I fix one, a new one arises.) The errors I have received so far include invalid string, Name not defined, ODBC not specified, etc.  All I really need is an example working document that successfully tests a database.  Any help would be greatly appreciated!  Thanks in advance!

P.S. I'm using the format with a .tsv type of file.

Jerry Schneider

unread,
Jul 24, 2015, 12:54:48 PM7/24/15
to lenn...@hotmail.com, robotframework-users
Not sure how you installed (from source or pip).  If from source, look in the test directory and you will see example .robot files for connecting to MySQL, PostgreSQL and SQLite.  If you installed from pip, check out the source and look in the test directory for examples or you can access it online at:
https://github.com/franz-see/Robotframework-Database-Library/tree/master/test

Test suites include testcases using most of the keywords in the library

PS, I recommend installing from source as PyPi isn't currently updated with the latest code.

jer


On 7/24/15 9:32 AM, Leonard Littleton wrote:
I need some help with the format of a Test Document using the DatabaseLibrary from Robot Framework.  The only thing I'm trying to do is connect to the database but every time I try, I get multiple errors.  (By multiple I mean when I fix one, a new one arises.) The errors I have received so far include invalid string, Name not defined, ODBC not specified, etc.  All I really need is an example working document that successfully tests a database.  Any help would be greatly appreciated!  Thanks in advance!

P.S. I'm using the format with a .tsv type of file.
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

-- 
Linux registered user #475536
Ubuntu registered user #28583

Leonard Littleton

unread,
Jul 24, 2015, 1:09:17 PM7/24/15
to robotframework-users, jer...@gmail.com
Could you elaborate more on MySQL, PostgreSQL, and SQLite? I downloaded everything from pip I do believe.  My understanding of the syntax for connecting to a database was that the first value was the python module.  I downloaded pyodbc through the pip install and when I think I have everything in working order, I get the SQL Driver Connect error.  I simply want to connect to the AdventureWorks2014 database in MS SQL Server.

Leonard Littleton

unread,
Jul 24, 2015, 1:14:22 PM7/24/15
to robotframework-users, jer...@gmail.com
Thanks a lot!! Changing pyodbc to sqlite3 worked! I wouldn't have gotten that without the link you provided!


On Friday, July 24, 2015 at 12:54:48 PM UTC-4, Jerry S. wrote:

Jerry Schneider

unread,
Jul 24, 2015, 1:19:27 PM7/24/15
to Leonard Littleton, robotframework-users
No problemo.  I have not tried working with MSSQL yet, but I think you will need to install pymssql.  Not sure if it can be done with ODBC either, unfortunately I have only been working with PostgreSQL, MySQL, SQLite and No SQL databases like MongoDB recently.

Glad to hear you got the SQLite working though, that is a good start in understanding it all.

jer

Leonard Littleton

unread,
Jul 24, 2015, 2:48:06 PM7/24/15
to robotframework-users, jer...@gmail.com
Well I thought I had it working...I downloaded pymssql and ran in to some problems.  Can you tell me how to locate all of the parameters that I need for the Connect to Database keyword? I use windows authentication for MS SQL Server 2014.  But I don't know how to determine the port or host.  Thanks again for your help!
Reply all
Reply to author
Forward
0 new messages