0% found this document useful (0 votes)
98 views3 pages

Database Testing Using Robot Framework

The document discusses testing databases using Robot Framework. It provides instructions on installing necessary libraries and software for connecting to a MySQL database. Keywords are listed that can be used for common database testing tasks like checking if a row exists, verifying row counts, selecting entire tables to return as lists, and executing queries.

Uploaded by

lavishak17
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
98 views3 pages

Database Testing Using Robot Framework

The document discusses testing databases using Robot Framework. It provides instructions on installing necessary libraries and software for connecting to a MySQL database. Keywords are listed that can be used for common database testing tasks like checking if a row exists, verifying row counts, selecting entire tables to return as lists, and executing queries.

Uploaded by

lavishak17
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 3

Database testing using Robot Framework

MySQL installer download link- https://dev.mysql.com/downloads/installer/


How to install- https://www.youtube.com/watch?v=iHTI_Nk7uwo

Robot Framework Database Library provides many useful keywords to test database. To use robot
framework database library, you need to download the file "pymssql-2.1.0.win-amd64-py2.7.exe" if your
computer is 64 bit and install it.

For connections (MySQL) - pip install pymssql

Robot Framework Library- DatabaseLibrary (pip install robotframework-databaselibrary)

https://franz-see.github.io/Robotframework-Database-Library/

Similarly ${DBpass}, ${DBport} and ${DBname} variables are created

Connection to database
Keywords

1. Check if exists in database

2. Row Count is less than X

Connect to Database pymysql ${DBname} ${DBuser} ${DBpass} ${DBhost} ${DBport}


Row Count is Less than X SELECT course_id from section 20

3. Selecting the entire table-returns a list

Using optional sansTran to run command without an explicit transaction commit or rollback:

@{queryResults} Query SELECT * FROM True


person

4. Using elements of list returned

@{queryresult} Query SELECT * FROM section;


Log Many @{queryresult}
Should Be Equal As Strings ${queryresult[0][0]} CSE-A

5. Execute query

You might also like