Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

Page Object Model in Selenium Robot Framework Python

In this example, you will learn how to use Page Object Model in Selenium Robot Framework Python test automation. We use RIDE to create Site Element resource file and Test Case. For RIDE example, please see other articles in this category. 

 

Test Case: authorized users are able to login Mahara Demo site. Here are test steps.

1. Navigate to demo.mahara.org and verify that web page title "Home-Mahara" displays.

2. Enter "student2" in the Username filed.

3. Enter "Testing1" in the Password field.

4. Click on the Login button

5. Assert that Dashboard Title is "Dashboard - Mahara".

Note: if the above username and password do not work, try registering one and use your own user account for testing because the demo user password may have been changed by others.

Selenium Python Robot Framework Implementation with Page Object Model

Print

Selenium Robot Framework Python Test Case with RIDE

In this example, you will learn how to use RIDE in Selenium Robot Framework Python test automation. 

Test Case: authorized users are able to login Mahara Demo site. Here are test steps.

 

1. Navigate to demo.mahara.org and verify that web page title "Home-Mahara" displays.

2. Enter "student2" in the Username filed.

3. Enter "Testing1" in the Password field.

4. Click on the Login button

5. Assert that Dashboard Title is "Dashboard - Mahara".

Note: if the above username and password do not work, try registering one and use your own user account for testing because the demo user password may have been changed by others.

Selenium Python Robot Framework Implementation

Print

Selenium Robot Framework Installation with Python

To use Robot Framework with Python, you need to install Python, robot framework, Selenium2Library and other supporting libraries. 

 

Step 1: Install Python 2.7 version

        Before installing Robot Framework, you need to install Python 2.5 or later. Robot Framework has not been updated to work with Python 3 or above, so you should certainly install Python 2.7 version. Visit the link to download and install Python 2.7 version. After installing Python 2.7, add your python installation to your system environment path. 

on Windows, add "c:\Python27\;c:\Python27\Scripts\;" to your path. On Windows vista or Windows 7 environment, it is recommended to install Python to all users, and to run the installation as an administrator. After installing, you can confirm python installation with the command below. 

Print

Selenium Robot Framework Introduction

Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). It has easy-to-use tabular test data syntax and it utilizes the keyword-driven testing approach. Its testing capabilities can be extended by test libraries implemented either with Python or Java, and users can create new higher-level keywords from existing ones using the same syntax that is used for creating test cases. (Source: http://robotframework.org/).

 

Robot framework project is hosted on Google code, where users can find technical documentation and source code. Robot framework Python language bindings are hosted at Pypi

Robot framework has following features: