SlideShare a Scribd company logo
Case Selenium
www.Seleniumonlinetraining.info
1. Acceptance testing
1. What you should test?
2.Robot Framework
3. Selenium
1. Syntax
2.Xpath
3. Command types
4.Common commands
5. Terms
4.Features
5. Demo
6.Tips’n’tricks
7. Selenium RS
www.Seleniumonlinetraining.info
• vs. unit testing
• Acceptance testing = UI testing
• Suunto requires us to write tests
o Good
• Suunto requires
o use of Selenium
o use of Robot Framework
www.Seleniumonlinetraining.info
 Test expected content
 Test links
 Test functions
 Test dynamic elements
 …
 http://seleniumhq.org/docs/06_test_design_
considerations.html#what-to-test
www.Seleniumonlinetraining.info
• Environment to run Selenium tests
• Automated
• I know nothing of Robot Framework, but it must be cool
www.Seleniumonlinetraining.info
• Selenium is a suite of automated tool for testing web
application front end – UI test framework
• Selenium emulates browser user
• Selenium commands are like "write text "Panu" to input
which id is "name""
• Selenium's language supports simple scripting (operators,
defining variables)
• Selenium supports multiple methods to locate elements
• Element ID
• Element name attribute
• Xpath
• DOM
• CSS
www.Seleniumonlinetraining.info
• XML query language
• Features
o Selecting nodes
 by path
 by predicates
 with wildcards
o Axes
o Operators
o Examples:
• //div[@id='cartable']/table/tbody/tr/td[1]
• //input[@value='Jatka']
• RTFM: http://www.w3schools.com/XPath/xpath_syntax.asp
www.Seleniumonlinetraining.info
Syntax
command target value
eg.
verifyTextPresent id=phone 0700123123
www.Seleniumonlinetraining.info
• Actions are commands that generally manipulate the state of
the application. They do things like “click this link” and “select
that option”. If an Action fails, or has an error, the execution of
the current test is stopped.
• Accessors examine the state of the application and store the
results in variables, e.g. “storeTitle”. They are also used to
automatically generate Assertions.
• Assertions are like Accessors, but they verify that the state of
the application conforms to what is expected. Examples include
“make sure the page title is X” and “verify that this checkbox is
checked”.
www.Seleniumonlinetraining.info
Test are divided to
• Test suites
• Test cases
Test suites are built from test cases.
Both test cases AND test suites should be parameterised.
www.Seleniumonlinetraining.info
open
opens a page using a URL.
click/clickAndWait
performs a click operation, and optionally waits for a new page to load.
verifyTitle/assertTitle
verifies an expected page title.
verifyTextPresent
verifies expected text is somewhere on the page.
verifyElementPresent
verifies an expected UI element, as defined by its HTML tag, is present on the page.
verifyText
verifies expected text and it’s corresponding HTML tag are present on the page.
verifyTable
verifies a table’s expected contents.
waitForPageToLoad
pauses execution until an expected new page loads. Called automatically when clickAndWait is used.
waitForElementPresent
pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.
www.Seleniumonlinetraining.info
 Firefox extension
 Very easy to get to know Selenium and to
play with it
 Also supports recording and running test
cases / suites
 http://seleniumhq.org/download/
 Features
 Recording tests, running tests, test cases, test
suites, breakpoints, pausing execution, export as
code
www.Seleniumonlinetraining.info
 B – set breakpoint
 X – execute command
 S – set starting point
 Good for debugging!
www.Seleniumonlinetraining.info
 Test Samuli’s application
 Transitions
 Adding cars, parameters
▪ Test constraints
 List cars
▪ Added cars are actually listened
www.Seleniumonlinetraining.info
• DON’t trust Selenium IDE or it’s default Xpath!
• You might have to change HTML code a bit to make it
easier to test automatically, eg. Add id/name attributes
• That’s completely OK!
• “AndWait” commands wait until whole page has been
loaded
• Very useful, but they don’t work with Ajax
• Difference between assert and verify
• If asset fails => test stops
• If verify fails => test continues
• echo command is good for debugging
www.Seleniumonlinetraining.info
 Selenium IDE has a poor support for programming, it does NOT
support
 condition statements
 iteration
 logging and reporting of test results
 error handling, particularly unexpected errors
 database testing
 test case grouping
 re-execution of failed tests
 test case dependency
 screenshot capture of test failures
 Selenium RS supports adding programming logic to tests
 .NET supported => though
 I have no experience
www.Seleniumonlinetraining.info
 http://seleniumhq.org/docs/index.html
 http://code.google.com/p/robotframework/
www.Seleniumonlinetraining.info

More Related Content

PDF
Selenium WebDriver: Tips and Tricks
PDF
Using The Page Object Pattern
PPTX
Selenium WebDriver - Test automation for web applications
PDF
Selenium 101
PPTX
Selenium for Jobseekers
PDF
How To Use Selenium Successfully
PDF
XpDays - Automated testing of responsive design (GalenFramework)
PDF
How To Grade Your Selenium Tests by Dave Haeffner - Sauce Labs Webinar
Selenium WebDriver: Tips and Tricks
Using The Page Object Pattern
Selenium WebDriver - Test automation for web applications
Selenium 101
Selenium for Jobseekers
How To Use Selenium Successfully
XpDays - Automated testing of responsive design (GalenFramework)
How To Grade Your Selenium Tests by Dave Haeffner - Sauce Labs Webinar

What's hot (20)

PDF
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
PPTX
Apex Testing Deep Dive
ODP
Selenium testing IDE 101
DOCX
Selenium interview questions
PDF
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
PPTX
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
PDF
APIs: A Better Alternative to Page Objects
PDF
Client side unit tests - using jasmine & karma
PDF
Angular Unit Testing from the Trenches
PDF
Introduction to Protractor
PDF
Getting Started with Selenium
KEY
JavaScript Testing VIA Selenium
PPTX
Galen Framework - Responsive Design Automation
PPTX
Angular Unit Testing
PDF
Angular Unit Testing NDC Minn 2018
PPTX
Cucumber with appium
PPT
Integration and Acceptance Testing
PPTX
Automated layout testing using Galen Framework
PDF
Mastering Test Automation: How to Use Selenium Successfully
PPTX
Angular Unit Test
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Apex Testing Deep Dive
Selenium testing IDE 101
Selenium interview questions
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium IDE Tutorial For Beginners | What Is Selenium IDE? | Selenium Tutori...
APIs: A Better Alternative to Page Objects
Client side unit tests - using jasmine & karma
Angular Unit Testing from the Trenches
Introduction to Protractor
Getting Started with Selenium
JavaScript Testing VIA Selenium
Galen Framework - Responsive Design Automation
Angular Unit Testing
Angular Unit Testing NDC Minn 2018
Cucumber with appium
Integration and Acceptance Testing
Automated layout testing using Galen Framework
Mastering Test Automation: How to Use Selenium Successfully
Angular Unit Test
Ad

Viewers also liked (15)

PDF
Robot handles
PPTX
Robot Framework : Lord of the Rings By Asheesh M
PDF
Robot framework - Lord of the Rings
PPT
Acceptance Test Driven Development using Robot Framework
PDF
Introduction to Robot Framework
PPTX
Web testing automation
PPTX
Robot Framework
PDF
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
PDF
Selenium, Appium, and Robots!
PDF
Acceptance testing plone sites and add ons with robot framework and selenium
PDF
Barcamp Bangkhen :: Robot Framework
PDF
Introduction to Robot Framework
PDF
Robot framework and selenium2 library
PDF
Robot Framework Introduction & Sauce Labs Integration
PDF
Robot Framework Introduction
Robot handles
Robot Framework : Lord of the Rings By Asheesh M
Robot framework - Lord of the Rings
Acceptance Test Driven Development using Robot Framework
Introduction to Robot Framework
Web testing automation
Robot Framework
JavaCro'14 - Test Automation using RobotFramework Libraries – Stojan Peshov
Selenium, Appium, and Robots!
Acceptance testing plone sites and add ons with robot framework and selenium
Barcamp Bangkhen :: Robot Framework
Introduction to Robot Framework
Robot framework and selenium2 library
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction
Ad

Similar to Selenium (2) (20)

PPTX
Selenium ide made easy
PPT
Selenium
PPTX
Selenium ppt
PPTX
Automated testing with selenium prasad bapatla
PPTX
Selenium
PPTX
Automation Testing
DOCX
Selenium introduction and some feautures
PDF
Selenium
PPTX
Selenium web driver
PPT
Selenium Concepts
PPT
Test automation using selenium presented by Quontra Solutions
ODP
Introduction to Selenium
PPTX
Selenium Testing
PPTX
Selenium
DOCX
What is selenium
PPT
Selenium ppt
PPT
Selenium and The Grinder
DOCX
Selenium notes
PPT
Selenium (1)
PPTX
Selenium ide made easy
Selenium
Selenium ppt
Automated testing with selenium prasad bapatla
Selenium
Automation Testing
Selenium introduction and some feautures
Selenium
Selenium web driver
Selenium Concepts
Test automation using selenium presented by Quontra Solutions
Introduction to Selenium
Selenium Testing
Selenium
What is selenium
Selenium ppt
Selenium and The Grinder
Selenium notes
Selenium (1)

More from onlinemindq (6)

PPT
Selenium 2
PPT
Selenium (2)
PPTX
Selenium.ppt
PPT
Selenium 2
PPT
A Buffer's Guide to Selenium 2
PPTX
Selenium Open Source Tool
Selenium 2
Selenium (2)
Selenium.ppt
Selenium 2
A Buffer's Guide to Selenium 2
Selenium Open Source Tool

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Pre independence Education in Inndia.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Sports Quiz easy sports quiz sports quiz
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Institutional Correction lecture only . . .
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Pharma ospi slides which help in ospi learning
Module 4: Burden of Disease Tutorial Slides S2 2025
Anesthesia in Laparoscopic Surgery in India
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Pre independence Education in Inndia.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
TR - Agricultural Crops Production NC III.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Sports Quiz easy sports quiz sports quiz
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Supply Chain Operations Speaking Notes -ICLT Program
VCE English Exam - Section C Student Revision Booklet
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Complications of Minimal Access Surgery at WLH
Institutional Correction lecture only . . .
Renaissance Architecture: A Journey from Faith to Humanism
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

Selenium (2)

  • 2. 1. Acceptance testing 1. What you should test? 2.Robot Framework 3. Selenium 1. Syntax 2.Xpath 3. Command types 4.Common commands 5. Terms 4.Features 5. Demo 6.Tips’n’tricks 7. Selenium RS www.Seleniumonlinetraining.info
  • 3. • vs. unit testing • Acceptance testing = UI testing • Suunto requires us to write tests o Good • Suunto requires o use of Selenium o use of Robot Framework www.Seleniumonlinetraining.info
  • 4.  Test expected content  Test links  Test functions  Test dynamic elements  …  http://seleniumhq.org/docs/06_test_design_ considerations.html#what-to-test www.Seleniumonlinetraining.info
  • 5. • Environment to run Selenium tests • Automated • I know nothing of Robot Framework, but it must be cool www.Seleniumonlinetraining.info
  • 6. • Selenium is a suite of automated tool for testing web application front end – UI test framework • Selenium emulates browser user • Selenium commands are like "write text "Panu" to input which id is "name"" • Selenium's language supports simple scripting (operators, defining variables) • Selenium supports multiple methods to locate elements • Element ID • Element name attribute • Xpath • DOM • CSS www.Seleniumonlinetraining.info
  • 7. • XML query language • Features o Selecting nodes  by path  by predicates  with wildcards o Axes o Operators o Examples: • //div[@id='cartable']/table/tbody/tr/td[1] • //input[@value='Jatka'] • RTFM: http://www.w3schools.com/XPath/xpath_syntax.asp www.Seleniumonlinetraining.info
  • 8. Syntax command target value eg. verifyTextPresent id=phone 0700123123 www.Seleniumonlinetraining.info
  • 9. • Actions are commands that generally manipulate the state of the application. They do things like “click this link” and “select that option”. If an Action fails, or has an error, the execution of the current test is stopped. • Accessors examine the state of the application and store the results in variables, e.g. “storeTitle”. They are also used to automatically generate Assertions. • Assertions are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include “make sure the page title is X” and “verify that this checkbox is checked”. www.Seleniumonlinetraining.info
  • 10. Test are divided to • Test suites • Test cases Test suites are built from test cases. Both test cases AND test suites should be parameterised. www.Seleniumonlinetraining.info
  • 11. open opens a page using a URL. click/clickAndWait performs a click operation, and optionally waits for a new page to load. verifyTitle/assertTitle verifies an expected page title. verifyTextPresent verifies expected text is somewhere on the page. verifyElementPresent verifies an expected UI element, as defined by its HTML tag, is present on the page. verifyText verifies expected text and it’s corresponding HTML tag are present on the page. verifyTable verifies a table’s expected contents. waitForPageToLoad pauses execution until an expected new page loads. Called automatically when clickAndWait is used. waitForElementPresent pauses execution until an expected UI element, as defined by its HTML tag, is present on the page. www.Seleniumonlinetraining.info
  • 12.  Firefox extension  Very easy to get to know Selenium and to play with it  Also supports recording and running test cases / suites  http://seleniumhq.org/download/  Features  Recording tests, running tests, test cases, test suites, breakpoints, pausing execution, export as code www.Seleniumonlinetraining.info
  • 13.  B – set breakpoint  X – execute command  S – set starting point  Good for debugging! www.Seleniumonlinetraining.info
  • 14.  Test Samuli’s application  Transitions  Adding cars, parameters ▪ Test constraints  List cars ▪ Added cars are actually listened www.Seleniumonlinetraining.info
  • 15. • DON’t trust Selenium IDE or it’s default Xpath! • You might have to change HTML code a bit to make it easier to test automatically, eg. Add id/name attributes • That’s completely OK! • “AndWait” commands wait until whole page has been loaded • Very useful, but they don’t work with Ajax • Difference between assert and verify • If asset fails => test stops • If verify fails => test continues • echo command is good for debugging www.Seleniumonlinetraining.info
  • 16.  Selenium IDE has a poor support for programming, it does NOT support  condition statements  iteration  logging and reporting of test results  error handling, particularly unexpected errors  database testing  test case grouping  re-execution of failed tests  test case dependency  screenshot capture of test failures  Selenium RS supports adding programming logic to tests  .NET supported => though  I have no experience www.Seleniumonlinetraining.info