Hi All,
i am sharing an example of how we can interact with database using robot framework. Since robot framework is a keyword driven framework, we just have to use few keywords to connect to db and have to provide few arguments to those keywods.
${DBUserName}= root
${DBPassword}= root
${DBPort}= 3306
${DBHost}= localhost
${DBName}= testdatabase
${dbapiModuleName}= pymysql ( PyMySQL is a database connector for Python, libraries to enable Python programs to talk to a MySQL server)
Connect To Database ${dbapiModuleName} ${DBName} ${DBUserName} ${DBPassword} ${DBHost} ${DBPort}
Table Must Exist employee
${query}= Query SELECT VALUE FROM employee WHERE emp_id='12345';
Log ${query}