Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

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

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

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

Selenium Robot Framework Table Verification

In this example, you will learn how to use Selenium2Library to verify tables in web application testing.

 

Selenium2Library has keywords: Get Table Cell, Table Cell Should Contain, Table Column Should Contain, Table Footer Should Contain, Table Header Should Contain and etc. In this table below, we verify that the first cell (row id=1 , column id=1) contains text "Test Case ID".

Robot Framework Table Test

Test Case ID Application Module Test Result Tester
TestCase001 Sign Up Pass TesterA
TestCase002 Login Fail TesterB
TestCase003 Logout Did not run TesterC
Print

Selenium Robot Framework Assign Element Id

In this example, you will learn how to use Selenium2Library to handle web elements with no Id or with dynamic locators in web application testing. Selenium2Library has keywords: Assign Id To Element. This keyword is very important if you need to define static id to elements that has very dynamic value or no id locator.

 

Print

Selenium Robot Framework Alert Example

In this example, you will learn how to use Selenium2Library to handle Alerts in web application testing. Selenium2Library has keywords: Alert Should Be Present and Get Alert Message.

 

Print

Selenium Robot Framework Python Cookie Example

In this example, you will learn how to use Selenium2Library to handle cookies in web application testing. Selenium2Library has keywords: Add Cookie, Delete All Cookie, Delete Cookie, Get Cookie Value, and Get Cookies.

 

Print

Robot Framework Selenium2Library Keywords

Selenium2Library is a web testing library for Robot Framework, and it runs tests in a real browser instance. It should work in most modern browsers and can be used with both Python and Jython interpreters. Before running tests that use Selenium2Library, Selenium2Library must be imported into your Robot test suite. Selenium2Library provides keywords to interact with cookies, web elements, browser windows and pages. Here is the full list of keywords in Selenium2Library.

Print

Selenium Robot Framework Element Locator

Locating elements on the website under test is very important for all keywords in Selenium2Library to interact with the element. In general, finding an element on the page take an argument, locator. By default, when a locator is provided, it is matched against the key attribute of the particular element type. For example, id and name are key attribute to all elements, and locating elements is easy using just the id as a locator. 

 

When id or name is not present, Selenium2Library supports other strategies to locate the element. See the chart below for other strategies: