SlideShare a Scribd company logo
1 of 24
Download to read offline
Introduction to Robot Framework and
Selenium2Library
Krishantha Samaraweera
WSO2 Inc.
Agenda
● Introduction to Robot
● Hello World Demo
● What is Selenium2library
● Ride IDE
● Maven and Ant plugin
● Demo time Again
Introduction
● Generic Test Automation Framework
● Keyword Driven Development
● Open source
○ Apache 2.0 License
○ Sponsored by Nokia Siemens networks and It was created by
Pekka Klärck as part of his master's thesis
● Based on Python
○ Can be extended using java or Python
○ Support for jython and ironPython
● Active Developer Community
● Hosted on Google code but moving to GIT now.
Demo - Hello World
image source : http://midches.com/for-customers/training-centers/
Installation on Linux
● Intall PIP
easy_install pip
● Install Python
pip install python
● Install Jyton (Optinal)
sudo apt-get install jython
● Install robot framework
pip install robotframework | easy_install robotframework
● Install ride (The IDE for robot test case writing)
pip install robotframework-ride | easy_install robotframework-ride
● Install Selenium2Library - Selenium implementation compatible with robot
pip install robotframework-selenium2library |
easy_install robotframework-selenium2library
Installation on Windows
- Windows Installer
● Separate graphical installers for 32 bit and 64 bit Windows systems
● robotframework-<version>.win-amd64.exe
- Stand-alone JAR package
● Robot Framework is also available as a stand-alone robotframework.
jar package.
● This package contains Jython and thus requires only JVM
○ java -jar robotframework.jar run [options] data_sources
- Use Python package installers
- Install from Source
Support for different runtimes
Environment Command
Python pybot
Jython jybot
Iron Python ipybot
Test Structure
Selenium Keyword
Open Browser <url> <browser>
Input Text <locator>
Click Button <locator>
Click Link
Close Browser
More Keywords
Add Cookie · Alert Should Be Present · Assign Id To Element · Capture Page Screenshot · Checkbox Should Be Selected · Checkbox Should Not
Be Selected ·Choose Cancel On Next Confirmation · Choose File · Choose Ok On Next Confirmation · Click Button · Click Element · Click Element
At Coordinates · Click Image · Click Link ·Close All Browsers · Close Browser · Close Window · Confirm Action · Create Webdriver · Current Frame
Contains · Current Frame Should Not Contain · Delete All Cookies ·Delete Cookie · Double Click Element · Drag And Drop · Drag And Drop By
Offset · Element Should Be Disabled · Element Should Be Enabled · Element Should Be Visible ·Element Should Contain · Element Should Not Be
Visible · Element Text Should Be · Execute Async Javascript · Execute Javascript · Focus · Frame Should Contain ·Get Alert Message · Get All
Links · Get Cookie Value · Get Cookies · Get Element Attribute · Get Horizontal Position · Get List Items · Get Location · Get Matching Xpath
Count ·Get Selected List Label · Get Selected List Labels · Get Selected List Value · Get Selected List Values · Get Selenium Implicit Wait · Get
Selenium Speed · Get Selenium Timeout ·Get Source · Get Table Cell · Get Text · Get Title · Get Value · Get Vertical Position · Get Window
Identifiers · Get Window Names · Get Window Size · Get Window Titles · Go Back ·Go To · Input Password · Input Text · List Selection Should Be ·
List Should Have No Selections · Location Should Be · Location Should Contain · Log Location · Log Source · Log Title ·Maximize Browser
Window · Mouse Down · Mouse Down On Image · Mouse Down On Link · Mouse Out · Mouse Over · Mouse Up · Open Browser · Open Context
Menu ·Page Should Contain · Page Should Contain Button · Page Should Contain Checkbox · Page Should Contain Element · Page Should
Contain Image · Page Should Contain Link ·Page Should Contain List · Page Should Contain Radio Button · Page Should Contain Textfield · Page
Should Not Contain · Page Should Not Contain Button ·Page Should Not Contain Checkbox · Page Should Not Contain Element · Page Should Not
Contain Image · Page Should Not Contain Link · Page Should Not Contain List ·Page Should Not Contain Radio Button · Page Should Not Contain
Textfield · Press Key · Radio Button Should Be Set To · Radio Button Should Not Be Selected ·Register Keyword To Run On Failure · Reload
Page · Select All From List · Select Checkbox · Select Frame · Select From List · Select From List By Index · Select From List By Label ·Select
From List By Value · Select Radio Button · Select Window · Set Browser Implicit Wait · Set Selenium Implicit Wait · Set Selenium Speed · Set
Selenium Timeout ·Set Window Size · Simulate · Submit Form · Switch Browser · Table Cell Should Contain · Table Column Should Contain ·
Table Footer Should Contain · Table Header Should Contain ·Table Row Should Contain · Table Should Contain · Textarea Should Contain ·
Textarea Value Should Be · Textfield Should Contain · Textfield Value Should Be · Title Should Be ·Unselect Checkbox · Unselect Frame ·
Unselect From List · Unselect From List By Index · Unselect From List By Label · Unselect From List By Value · Wait For Condition ·Wait Until
Element Is Visible · Wait Until Page Contains · Wait Until Page Contains Element · Xpath Should Match X Times
http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.
html
Tabular Format
● Simple tabular format
Robot Standard Libraries
● Included in normal installation
○ Operating System
○ Screenshot
○ Dialog
○ Telnet
○ XML
○ String
○ Process
○ Remote
Robot External Libraries
● Not Included in normal installation. Need to install
separately.
○ Selenium2Library
○ HTTP
○ Android
○ MongoDB
○ iOS
○ SSH
○ Database
○ AutoItLibrary
Page Should Contain Google
One Spacebar
Be Careful
Four Spacebars
Selenium2Library
● Web Testing Library for Robot Framework.
● Runs on Real Browser instance.
● InBuild API keywords for easy usage.
Selenium2Library Vs Webdriver API
Selenium 2 Webdriver Iterating Table
C# Example
public void VerifyTable(string header, string expected)
{
IWebElement table = _driverWithJs.FindElement(By.XPath("//div[@id='main']/table"));
ReadOnlyCollection<IWebElement> allRows = table.FindElements(By.TagName("tr"));
for (int z = 0; z < allRows.Count; z++)
{
ReadOnlyCollection<IWebElement> cells = allRows[z].FindElements(By.TagName("td"));
for (int y = 0; y < cells.Count; y++)
{
var value = allRows[z].FindElements(By.TagName("td"))[y].Text;
if (value.Equals(header))
{
Assert.AreEqual(expected, allRows[z].FindElements(By.TagName("td"))[y + 1].Text);
}
}
}
}
Robot keyword for Iterating Table
Table Should Contain table_locator, expected, loglevel=INFO
Selenium2Library
● Lookup Strategy
Test Data Editor - RIDE
Custom Keyword Library
Image source : http://midches.com/for-customers/training-centers/
Maven Plugin
● Robot Framework in a Maven project without the need to
install anything extra.
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.2</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Ant Task
● RobotAnt is a ant task for using robotframework inside
ant build scripts.
<robotant
data_sources="TestSelenium.html"
loglevel="INFO"
debugfile="jybot.log"
outputdir="results"
maxmemory="512m">
<classpath>
<pathelement location="libext/robotframework-2.5.5.jar"/>
<pathelement location="lib/Lib"/>
</classpath>
</robotant>
External variable files
● External file to declare variables.
● To follow DRY (Don’t repeat yourself)
● Can be created in python or java files.
*** Variables ***
${Weather} London Cloudy 25
${humidity} 75
${MARKS} 65.5
@{DAYS} Monday Wednesday Friday
Sunday
For more information
● The main information hub http://robotframework.org
● Quick Start Guide
– Executable guide demonstrating the key features
– http://code.google.com/p/robotframework/wiki/QuickStartGuide
● User Guide
– Detailed information about all features of the framework
– http://code.google.com/p/robotframework/wiki/UserGuide
Questions?
Thanks!
Image source : http://ciprianocounseling.com/frequently-asked-questions/

More Related Content

What's hot

Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Frameworklaurent bristiel
 
Robot Framework :: Demo login application
Robot Framework :: Demo login applicationRobot Framework :: Demo login application
Robot Framework :: Demo login applicationSomkiat Puisungnoen
 
Robot framework
Robot frameworkRobot framework
Robot frameworkboriau
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationSauce Labs
 
Introduction to Robot Framework (external)
Introduction to Robot Framework (external)Introduction to Robot Framework (external)
Introduction to Robot Framework (external)Zhe Li
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test AutomationPekka Klärck
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingBethmi Gunasekara
 
Présentation de Robot framework
Présentation de Robot frameworkPrésentation de Robot framework
Présentation de Robot frameworkgilleslenfant
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot FrameworkFurkan Ertürk
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionGanuka Yashantha
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Frameworkvaluebound
 
Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Jaehoon Oh
 
Robot Framework with Python | Edureka
Robot Framework with Python | EdurekaRobot Framework with Python | Edureka
Robot Framework with Python | EdurekaEdureka!
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber Knoldus Inc.
 

What's hot (20)

Robot Framework
Robot FrameworkRobot Framework
Robot Framework
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Framework
 
Robot Framework :: Demo login application
Robot Framework :: Demo login applicationRobot Framework :: Demo login application
Robot Framework :: Demo login application
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
 
Introduction to Robot Framework (external)
Introduction to Robot Framework (external)Introduction to Robot Framework (external)
Introduction to Robot Framework (external)
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
Présentation de Robot framework
Présentation de Robot frameworkPrésentation de Robot framework
Présentation de Robot framework
 
Appium & Robot Framework
Appium & Robot FrameworkAppium & Robot Framework
Appium & Robot Framework
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introduction
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Framework
 
Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
Python unit testing
Python unit testingPython unit testing
Python unit testing
 
Robot Framework with Python | Edureka
Robot Framework with Python | EdurekaRobot Framework with Python | Edureka
Robot Framework with Python | Edureka
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 

Viewers also liked

Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introductionlaurent bristiel
 
Acceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and seleniumAcceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and seleniumAsko Soukka
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot FrameworkCarl Su
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkSteve Zhang
 
Robot framework - Lord of the Rings
Robot framework - Lord of the RingsRobot framework - Lord of the Rings
Robot framework - Lord of the RingsAsheesh Mehdiratta
 
Robot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh MRobot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh MAgile Testing Alliance
 
Testing More With Less
Testing More With LessTesting More With Less
Testing More With LessTom Swain
 
Steps to register a foreign invested company
Steps to register a foreign invested companySteps to register a foreign invested company
Steps to register a foreign invested companyБ. Нарангэрэл
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Franz Allan See
 
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...Xebia Nederland BV
 
Automatisations des tests fonctionnels avec Robot Framework
Automatisations des tests fonctionnels avec Robot FrameworkAutomatisations des tests fonctionnels avec Robot Framework
Automatisations des tests fonctionnels avec Robot Frameworklaurent bristiel
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework OpenDaylight
 
Acceptance Test Driven Development using Robot Framework
Acceptance Test Driven Development using Robot FrameworkAcceptance Test Driven Development using Robot Framework
Acceptance Test Driven Development using Robot FrameworkAsheesh Mehdiratta
 
Web testing automation
Web testing automationWeb testing automation
Web testing automationkuozui
 
Barcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot FrameworkBarcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot FrameworkSomkiat Puisungnoen
 
Stressez votre application web avec Gatling
Stressez votre application web avec GatlingStressez votre application web avec Gatling
Stressez votre application web avec Gatlinglaurent bristiel
 

Viewers also liked (17)

Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan PeshovJavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
 
Acceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and seleniumAcceptance testing plone sites and add ons with robot framework and selenium
Acceptance testing plone sites and add ons with robot framework and selenium
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
Robot framework - Lord of the Rings
Robot framework - Lord of the RingsRobot framework - Lord of the Rings
Robot framework - Lord of the Rings
 
Robot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh MRobot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh M
 
Testing More With Less
Testing More With LessTesting More With Less
Testing More With Less
 
Steps to register a foreign invested company
Steps to register a foreign invested companySteps to register a foreign invested company
Steps to register a foreign invested company
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
 
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
 
Automatisations des tests fonctionnels avec Robot Framework
Automatisations des tests fonctionnels avec Robot FrameworkAutomatisations des tests fonctionnels avec Robot Framework
Automatisations des tests fonctionnels avec Robot Framework
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework
 
Acceptance Test Driven Development using Robot Framework
Acceptance Test Driven Development using Robot FrameworkAcceptance Test Driven Development using Robot Framework
Acceptance Test Driven Development using Robot Framework
 
Web testing automation
Web testing automationWeb testing automation
Web testing automation
 
Barcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot FrameworkBarcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot Framework
 
Stressez votre application web avec Gatling
Stressez votre application web avec GatlingStressez votre application web avec Gatling
Stressez votre application web avec Gatling
 

Similar to Robot framework and selenium2 library

What's new in selenium 4
What's new in selenium 4What's new in selenium 4
What's new in selenium 4Knoldus Inc.
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupDave Haeffner
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)Igalia
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionAmr E. Mohamed
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectKnoldus Inc.
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicCarlos Tadeu Panato Junior
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicChaordic
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternSargis Sargsyan
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternSQALab
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) Volkan Özçelik
 
Selenium In The Real World
Selenium In The Real WorldSelenium In The Real World
Selenium In The Real Worldiainrose
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Sargis Sargsyan
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Volkan Özçelik
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesVolkan Özçelik
 

Similar to Robot framework and selenium2 library (20)

What's new in selenium 4
What's new in selenium 4What's new in selenium 4
What's new in selenium 4
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
 
Selenium In The Real World
Selenium In The Real WorldSelenium In The Real World
Selenium In The Real World
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 

Recently uploaded

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 

Recently uploaded (20)

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 

Robot framework and selenium2 library

  • 1. Introduction to Robot Framework and Selenium2Library Krishantha Samaraweera WSO2 Inc.
  • 2. Agenda ● Introduction to Robot ● Hello World Demo ● What is Selenium2library ● Ride IDE ● Maven and Ant plugin ● Demo time Again
  • 3. Introduction ● Generic Test Automation Framework ● Keyword Driven Development ● Open source ○ Apache 2.0 License ○ Sponsored by Nokia Siemens networks and It was created by Pekka Klärck as part of his master's thesis ● Based on Python ○ Can be extended using java or Python ○ Support for jython and ironPython ● Active Developer Community ● Hosted on Google code but moving to GIT now.
  • 4. Demo - Hello World image source : http://midches.com/for-customers/training-centers/
  • 5. Installation on Linux ● Intall PIP easy_install pip ● Install Python pip install python ● Install Jyton (Optinal) sudo apt-get install jython ● Install robot framework pip install robotframework | easy_install robotframework ● Install ride (The IDE for robot test case writing) pip install robotframework-ride | easy_install robotframework-ride ● Install Selenium2Library - Selenium implementation compatible with robot pip install robotframework-selenium2library | easy_install robotframework-selenium2library
  • 6. Installation on Windows - Windows Installer ● Separate graphical installers for 32 bit and 64 bit Windows systems ● robotframework-<version>.win-amd64.exe - Stand-alone JAR package ● Robot Framework is also available as a stand-alone robotframework. jar package. ● This package contains Jython and thus requires only JVM ○ java -jar robotframework.jar run [options] data_sources - Use Python package installers - Install from Source
  • 7. Support for different runtimes Environment Command Python pybot Jython jybot Iron Python ipybot
  • 9. Selenium Keyword Open Browser <url> <browser> Input Text <locator> Click Button <locator> Click Link Close Browser
  • 10. More Keywords Add Cookie · Alert Should Be Present · Assign Id To Element · Capture Page Screenshot · Checkbox Should Be Selected · Checkbox Should Not Be Selected ·Choose Cancel On Next Confirmation · Choose File · Choose Ok On Next Confirmation · Click Button · Click Element · Click Element At Coordinates · Click Image · Click Link ·Close All Browsers · Close Browser · Close Window · Confirm Action · Create Webdriver · Current Frame Contains · Current Frame Should Not Contain · Delete All Cookies ·Delete Cookie · Double Click Element · Drag And Drop · Drag And Drop By Offset · Element Should Be Disabled · Element Should Be Enabled · Element Should Be Visible ·Element Should Contain · Element Should Not Be Visible · Element Text Should Be · Execute Async Javascript · Execute Javascript · Focus · Frame Should Contain ·Get Alert Message · Get All Links · Get Cookie Value · Get Cookies · Get Element Attribute · Get Horizontal Position · Get List Items · Get Location · Get Matching Xpath Count ·Get Selected List Label · Get Selected List Labels · Get Selected List Value · Get Selected List Values · Get Selenium Implicit Wait · Get Selenium Speed · Get Selenium Timeout ·Get Source · Get Table Cell · Get Text · Get Title · Get Value · Get Vertical Position · Get Window Identifiers · Get Window Names · Get Window Size · Get Window Titles · Go Back ·Go To · Input Password · Input Text · List Selection Should Be · List Should Have No Selections · Location Should Be · Location Should Contain · Log Location · Log Source · Log Title ·Maximize Browser Window · Mouse Down · Mouse Down On Image · Mouse Down On Link · Mouse Out · Mouse Over · Mouse Up · Open Browser · Open Context Menu ·Page Should Contain · Page Should Contain Button · Page Should Contain Checkbox · Page Should Contain Element · Page Should Contain Image · Page Should Contain Link ·Page Should Contain List · Page Should Contain Radio Button · Page Should Contain Textfield · Page Should Not Contain · Page Should Not Contain Button ·Page Should Not Contain Checkbox · Page Should Not Contain Element · Page Should Not Contain Image · Page Should Not Contain Link · Page Should Not Contain List ·Page Should Not Contain Radio Button · Page Should Not Contain Textfield · Press Key · Radio Button Should Be Set To · Radio Button Should Not Be Selected ·Register Keyword To Run On Failure · Reload Page · Select All From List · Select Checkbox · Select Frame · Select From List · Select From List By Index · Select From List By Label ·Select From List By Value · Select Radio Button · Select Window · Set Browser Implicit Wait · Set Selenium Implicit Wait · Set Selenium Speed · Set Selenium Timeout ·Set Window Size · Simulate · Submit Form · Switch Browser · Table Cell Should Contain · Table Column Should Contain · Table Footer Should Contain · Table Header Should Contain ·Table Row Should Contain · Table Should Contain · Textarea Should Contain · Textarea Value Should Be · Textfield Should Contain · Textfield Value Should Be · Title Should Be ·Unselect Checkbox · Unselect Frame · Unselect From List · Unselect From List By Index · Unselect From List By Label · Unselect From List By Value · Wait For Condition ·Wait Until Element Is Visible · Wait Until Page Contains · Wait Until Page Contains Element · Xpath Should Match X Times http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library. html
  • 11. Tabular Format ● Simple tabular format
  • 12. Robot Standard Libraries ● Included in normal installation ○ Operating System ○ Screenshot ○ Dialog ○ Telnet ○ XML ○ String ○ Process ○ Remote
  • 13. Robot External Libraries ● Not Included in normal installation. Need to install separately. ○ Selenium2Library ○ HTTP ○ Android ○ MongoDB ○ iOS ○ SSH ○ Database ○ AutoItLibrary
  • 14. Page Should Contain Google One Spacebar Be Careful Four Spacebars
  • 15. Selenium2Library ● Web Testing Library for Robot Framework. ● Runs on Real Browser instance. ● InBuild API keywords for easy usage.
  • 16. Selenium2Library Vs Webdriver API Selenium 2 Webdriver Iterating Table C# Example public void VerifyTable(string header, string expected) { IWebElement table = _driverWithJs.FindElement(By.XPath("//div[@id='main']/table")); ReadOnlyCollection<IWebElement> allRows = table.FindElements(By.TagName("tr")); for (int z = 0; z < allRows.Count; z++) { ReadOnlyCollection<IWebElement> cells = allRows[z].FindElements(By.TagName("td")); for (int y = 0; y < cells.Count; y++) { var value = allRows[z].FindElements(By.TagName("td"))[y].Text; if (value.Equals(header)) { Assert.AreEqual(expected, allRows[z].FindElements(By.TagName("td"))[y + 1].Text); } } } } Robot keyword for Iterating Table Table Should Contain table_locator, expected, loglevel=INFO
  • 19. Custom Keyword Library Image source : http://midches.com/for-customers/training-centers/
  • 20. Maven Plugin ● Robot Framework in a Maven project without the need to install anything extra. <plugin> <groupId>org.robotframework</groupId> <artifactId>robotframework-maven-plugin</artifactId> <version>1.4.2</version> <executions> <execution> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
  • 21. Ant Task ● RobotAnt is a ant task for using robotframework inside ant build scripts. <robotant data_sources="TestSelenium.html" loglevel="INFO" debugfile="jybot.log" outputdir="results" maxmemory="512m"> <classpath> <pathelement location="libext/robotframework-2.5.5.jar"/> <pathelement location="lib/Lib"/> </classpath> </robotant>
  • 22. External variable files ● External file to declare variables. ● To follow DRY (Don’t repeat yourself) ● Can be created in python or java files. *** Variables *** ${Weather} London Cloudy 25 ${humidity} 75 ${MARKS} 65.5 @{DAYS} Monday Wednesday Friday Sunday
  • 23. For more information ● The main information hub http://robotframework.org ● Quick Start Guide – Executable guide demonstrating the key features – http://code.google.com/p/robotframework/wiki/QuickStartGuide ● User Guide – Detailed information about all features of the framework – http://code.google.com/p/robotframework/wiki/UserGuide
  • 24. Questions? Thanks! Image source : http://ciprianocounseling.com/frequently-asked-questions/