Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

Robot Framework Database Testing

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.

 

If your computer is 32 bit, you can download specific version. See the example below. 

Print

Ajax Synchronization Robot Framework Python

When testing web application, if web page loads data with jQuery Ajax call, we need to wait until the active ajax call is completed to interact with the element. In Selenium Robot Framework, we can use For Loop and Exit For Loop methods to achieve the ajax dynamic Ajax Synchronization.

Print

For Loop in Robot Framework Python

When using robot framework to test web application, we may need to use for loop to iterate over elements in a list or numbers in a range. The example below shows you how to use for loop.

 

Print

Read Xml File in Robot Framework Python

Robot Framework has builtIn libraries to manipulate xml file in testing. In this example, you will learn how to read xml file, get element by xpath and element attribute.

 

Print

Run Tests in Certain Order in Robot Framework Python

In robot framework, we may need to run tests in a certain order when tests are dependent on other tests in previous orders. Generally speaking, in a test suite, tests will run in the order by which they are created. However, for easily seeing the order of tests, users can prefix tests with numbers. See the example below.

 

Print

Run Certain Tests With Tags in Robot Framework Python

An application may have a lot of modules to test. When your robot framework has many tests/suites, you may need to run certain tests as smoke tests or integration tests to save time or to test specific modules. In robot framework, tagging tests will enable you to pick certain tests to run. See the example below.

 

Print

Get Environment Variables In Robot Framework Python

In some cases, test report should include computer name, user name and operating system to identify on which computer tests were run, who run the test, and on what operating system tests were run.  All of these information are environment variables. In Robot Framework we can obtain environment variables by using Operating System provided keywords.  See the example below. 

 

Print

Pdf Comparison In Robot Framework Python

Pdf comparison is a challenging work in test automation. In this example below, you will learn how to compare pdf files in Robot Framework Python. To compare pdf files (1) you need to install PDFMiner on your PC. (2) you need to use the code provided by Selenium Master and install it under the folder C:\Python27\Lib\site-packages\Pdf2TextLibrary.

 

PDFMiner is a tool for extracting information from PDF documents. It focuses on getting and analyzing text data.  Selenium Master wrote a python code to get page counts of a pdf file and extract its text. In this example, we have three pdf files as listed in the table below. 

Pdf File Name Page Count Text Content
 smpdf1.pdf  1  Selenium Master Pdf Comparison
smpdf2.pdf   1  Selenium Master Pdf Comparison
smpdf3.pdf   2  Selenium Master Pdf Comparison

Page 1
Sunday, August 17, 2014

 

Selenium Master Pdf Comparison
Page 2
Sunday, August 17, 2014

 When we compare the above 3 files, page count and text content should be equal for smpdf1.pdf and smpdf2.pdf.  However, page count and text content should not be equal for smpdf1.pdf and smpdf3.pdf. Click the link to see the result file. See the python library code and robot framework code. 

Print

Send Email in Robot Framework Python Using Gmail

When using Robot Framework Python, some customized test result log files or report files need to be emailed to QA engineers. You can create custom Gmail Email Library to send email with attachment or no attachment.  

 

Step 1:  create a folder named "GmailEmailLibrary" under C:\Python27\Lib\site-packages (assuming that you have installed python at the root of C: drive)

C:\Python27\Lib\site-packages\GmailEmailLibrary

Step 2: write following codes in the file "gmailsendemail.py" and "__init__.py"