Robot Framework
-
Upload
onur-baskirt -
Category
Software
-
view
531 -
download
0
Transcript of Robot Framework
![Page 1: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/1.jpg)
ROBOT FRAMEWORKOnur Baskirt
![Page 2: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/2.jpg)
Who am I?▪ I am Onur Başkırt
▪ Currently, Head of SW Testing at Kariyer.net
▪ Co-owner of www.swtestacademy.com and a Test Hive Member
▪ Formerly, Teknosa, Ericsson, Huawei, ST-Ericsson, Bahçeşehir University
![Page 3: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/3.jpg)
Table of Contents
▪ What is Robot Framework?
▪ Robot Framework Architecture and Test Flow
▪ Libraries
▪ Tools
▪ How to install Robot Framework on Windows?
▪ Robot Framework Usage with an Example
![Page 4: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/4.jpg)
What is Robot Framework?▪ Robot Framework is a generic test automation framework.
▪ It has easy-to-use tabular test data syntax.
▪ It utilizes the keyword-driven testing approach.
▪ Its testing capabilities can be extended by test libraries.
▪ Users can create new higher-level keywords from existing ones using the same syntax.
▪ It is operating system and application independent. The core framework is implemented using Python.
▪ Robot Framework itself is open source.
![Page 5: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/5.jpg)
Robot Framework Architecture and Test Flow▪ When test execution is started, the framework
first parses the test data.
▪ It then utilizes keywords provided by the test libraries to interact with the system under test.
▪ Libraries can communicate with the system either directly or using other test tools as drivers.
▪ Test execution is started from the command line and at the end of execution you get report and log HTML format as well as XML output.
![Page 6: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/6.jpg)
Libraries▪ Test libraries provide the actual testing capabilities to Robot Framework by
providing keywords.
![Page 7: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/7.jpg)
Libraries
![Page 8: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/8.jpg)
Libraries
![Page 9: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/9.jpg)
Tools
![Page 10: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/10.jpg)
Tools
![Page 11: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/11.jpg)
Tools
![Page 12: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/12.jpg)
How to install Robot Framework on Windows?▪ We will install Robot Framework with pip.
▪ Pip is the standard Python package manager and is already installed if you’re using Python 2 >=2.7.9 or Python 3 >=3.4
![Page 13: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/13.jpg)
How to install Robot Framework on Windows?▪ Step-1: Install Phyton
Go to https://www.python.org/ , download and install Python 2.7.x version
![Page 14: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/14.jpg)
How to install Robot Framework on Windows?▪ Step-2: Install Robot Framework
Open command prompt and run below command.
pip install robotframework
![Page 15: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/15.jpg)
How to install Robot Framework on Windows?▪ Step-3: Upgrade pip
Upgrade the pip with below command.
python -m pip install -U pip
![Page 16: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/16.jpg)
How to install Robot Framework on Windows?▪ Step-4: Verifying Installation
After a successful installation, you should be able to execute below commands and get both Robot Framework and interpreter versions.
robot --version
rebot --version
![Page 17: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/17.jpg)
How to install Robot Framework on Windows?▪ Note: If you have any problem please check Path configuration and restart
your PC. Path configuration must be as same as below figure.
![Page 18: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/18.jpg)
How to install Robot Framework on Windows?▪ Step-5: Upgrade Robot Framework
Upgrading to a new version required either using the –upgrade option:
pip install --upgrade robotframework
or specifying the version to use explicitly:
pip install robotframework==2.9.2
Note: You can uninstall Robot Framework anytime with below command.
pip uninstall robotframework
![Page 19: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/19.jpg)
How to install Robot Framework on Windows?▪ Step-6: Installing RIDE (Robot Framework Test Data Editor)
▪ Python 2.6 is the minimum version.
▪ Notice that similarly as Robot Framework, RIDE does not yet support Python 3.
▪ Notice also that on OS X RIDE requires 32-bit Python version.
![Page 20: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/20.jpg)
How to install Robot Framework on Windows?▪ Step-6: Installing RIDE (Robot Framework Test Data Editor)
▪ Step-6.1: Python must be installed. (We installed it)
![Page 21: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/21.jpg)
How to install Robot Framework on Windows?▪ Step-6: Installing RIDE (Robot Framework Test Data Editor)
▪ Step-6.2: wxPyhton must be installed.
We need to install “wxPyhton2.8-win32-unicode-2.8.12.1-py27.exe” 32-bit version.
WARNING!If you install latest version, you will get below error!
![Page 22: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/22.jpg)
How to install Robot Framework on Windows?▪ Step-6: Installing RIDE (Robot Framework Test Data Editor)
▪ Step-6.3: Install RIDE with below pip command
pip install robotframework-ride
![Page 23: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/23.jpg)
How to install Robot Framework on Windows?▪ Step-6: Installing RIDE (Robot Framework Test Data Editor)
▪ Step-6.4: After a successful installation, RIDE can be started from the command line by running ride.py.
![Page 24: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/24.jpg)
How to install Robot Framework on Windows?▪ Step-7: Install Selenium 2 (WebDriver) Library
Selenium2Library is a web testing library for Robot Framework that leverages the Selenium 2 (WebDriver) libraries from the Selenium project.
Installation Command:
pip install robotframework-selenium2library
![Page 25: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/25.jpg)
How to install Robot Framework on Windows?▪ Step-8: Upgrade Selenium 2 (WebDriver) Library
Upgrade Command:
pip install --upgrade robotframework-selenium2library
![Page 26: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/26.jpg)
Robot Framework Usage with an Example▪ Test Scenario:
▪ Open www.kariyer.net
▪ Check Title
▪ Maximize Browser
▪ Go to User Login Page
▪ Enter User Name
▪ Enter Wrong Password
▪ Click Login
▪ Wait 2 seconds
▪ Assert Warning Message
▪ Close Browser
![Page 27: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/27.jpg)
Robot Framework Usage with an Example▪ Directory Structure:
▪ setup.robot file holds Settings, Variables, Keywords information
▪ KariyerLoginTest.robot file contains Test Cases which are using our High Level Keywords
![Page 28: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/28.jpg)
Robot Framework Usage with an Example▪ Setup.robot:
▪ KariyerLoginTest.robot:
setup.robot
KariyerLoginTest.robot
![Page 29: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/29.jpg)
Robot Framework Usage with an Example▪ Run the Test on Command Prompt robot KariyerLoginTest.robot
▪ Report and log results will be automatically generated after the test execution.
![Page 30: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/30.jpg)
Robot Framework Usage with an Example▪ Run the Test on RIDE▪ Open cmd prompt and write “ride.py” and then press Enter. Then, you will see
RIDE editor.
▪ Go to File >> New Project and then give a name to your project as shown below.
![Page 31: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/31.jpg)
Robot Framework Usage with an Example▪ Add Resource File
![Page 32: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/32.jpg)
Robot Framework Usage with an Example▪ After adding Resource File
![Page 33: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/33.jpg)
Robot Framework Usage with an Example▪ Write your robot test
![Page 34: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/34.jpg)
Robot Framework Usage with an Example▪ Write your robot test
![Page 35: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/35.jpg)
Robot Framework Usage with an Example▪ Run The Test
![Page 36: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/36.jpg)
Robot Framework Usage with an Example▪ While Test is Running
![Page 37: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/37.jpg)
Robot Framework Usage with an Example▪ When Test finished.
![Page 38: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/38.jpg)
Robot Framework Usage with an Example▪ REPORT
![Page 39: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/39.jpg)
Robot Framework Usage with an Example▪ LOG
![Page 40: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/40.jpg)
For More Information▪ http://www.swtestacademy.com/getting-started-robotframework/
![Page 41: Robot Framework](https://reader033.fdocuments.in/reader033/viewer/2022061608/587d8c9e1a28abcd648b66cb/html5/thumbnails/41.jpg)
QUESTIONS?