SlideShare a Scribd company logo
Selenium
Automation Testing with
Selenium
Wien, 21. Oktober,
2010
Monica
Nanu
Summary
Selenium – General overview
Risks and structuring the test project
Showcase: Implementation for TEMPO
Selenium – General Overview
What is Selenium? The Selenium components
Steps in developing automation tests
Future development – Selenium 2.0
Selenium is a suite of tools to automate web application testing across many
platforms.
What is Selenium
Framework for automation testing tool for web applications
IDE for record / playback → creation of tests → learning language
DSL for writing test scripts in Java, Ruby and others
Support for all major browsers
Selenium components
Selenium IDE
Selenium Remote Control
Selenium Grid
Selenium – General Overview
●
Steps:
Selenium IDE: Record and playback
Selenium IDE: Export as Java code
Selenium RC: Execute Java(Eclipse-Junit)
Selenium GRID: distribute on various
environments
Selenium – General Overview
Selenium commands (Selenese)
A set of commands that run the tests for a web-
based application:
check if the correct UI elements exist;
check the specific content of the UI elements;
check that all links are functional;
check data entry field (input of data and check of
the values);
checks the option selection on different UI
elements (radio buttons, check boxes, drop down
lists);
checks the form submit options;
check for applications using Ajax calls.
There are 3 Types of commands:
Actions - commands that manage the state of
the application
“click link”, “select option”, Fail = the execution of the test
case stops/ends, ...AndWait – a post-back is set and
Selenium waits until the execution is completed
Accessors – check the state of the variables
that are used in Assert commands
Assertions – check that the state of the
aplication is exactly what and how is expected.
E.g.. “the title of the page is ”abc” or that “checkbox
is selected”. There are 3 methods to check:
“assert” (the test stops),
“verify”(error is logged and the test
continues )
” waitFor” (awaits until a restriction is
aquired – used for testing applications with
Selenium – General Overview
Client library : Transforms the Java calls into server commands, by encoding it into the
“Selenese” network protocol (on top of HTTP) and sending it to the Selenium server.
E.g. “start browser”, “click-to”...
Server component: Listens for commands from clients (on a TCP socket) and performs
actions accordingly.
E.g. starting web-browser or forwarding “user interaction” to the web-browser and delivering back
the result to the client.
Selenium – General Overview
Speeds up functional testing of web-applications by leveraging the existing computing
infrastructure;
Allows easily running multiple tests in parallel, on multiple machines, in an
heterogeneous environment;
Allows running multiple instances of Selenium Remote Control in parallel. Even better, it
makes all these Selenium Remote Controls appear as a single one, so the tests do not
have to worry about the actual infrastructure;
Selenium Grid cuts down on the time required to run a Selenium test suite to a fraction
of the time that a single instance of Selenium instance would take to run.
Selenium – General Overview
Strong Points:
Open source tool for web application (no license costs, large community for support and cont. dev.);
support for multi platform and multi browser in terms of coverage;
DOM testing – simple and strong;
The TC are stable, for mature versions;
Supports testing AJAX applications;
Allows building flexible testing scenarios within the power of Java.
Weak Points:
Error diagnoze and reporting;
Upon UI changes, the scripts need update (general for all automation tools);
It is state dependent (html driven);
May require more knowledge (learning effort may be high in the beginning).
Future and actual Selenium projects:
Selenium 2.0 (Selenium + WebDriver)
Drivers: HtmlUnit / Firefox / IE / Chrome
Selenium – review
Starting point: Test Plan
Functionality tree and initial evaluation of total effort (main functionalities and test cases)
Manual versus Automation testing
Risk evaluation
Decision for the solution of automation testing
GUI and usability
Performance
Regressions and others
Main risks to evaluate for automation:
No automation - The quality of the testing and the time invested
The cost of development and maintenance of the automated tests
Result: We implement the automation testing in a structured layered architecture using Selenium
Selenium – review
Test Project Structure
Working together with Development and QA to implement the test framework structure.
separate test-framework code from the actual tests classes
separating reusable, generic test-framework code from a project specific code
QA
Dev
T e s t c l a s s e s
L o g i n M o d u l e 1 M o d u l e 2 C o m m o n
T e s t c l a s s e s
L o g i nL o g i n M o d u l e 1M o d u l e 1 M o d u l e 2M o d u l e 2 C o m m o nC o m m o n
P r o j e c t s p e c i f i c f r a m e w o r k
P a g e 1 - n P a n e 1 - n C o m m o n O t h e r . . .
P r o j e c t s p e c i f i c f r a m e w o r k
P a g e 1 - nP a g e 1 - n P a n e 1 - nP a n e 1 - n C o m m o nC o m m o n O t h e r . . .O t h e r . . .
TestFramework
UtilProjectTestcases
TestFramework
UtilUtilProjectProjectTestcasesTestcases
)
B D r i v e r H T M L
E l e m e n t s
P a g e O b j e c t s
)
B D r i v e rB D r i v e r H T M L
E l e m e n t s
H T M L
E l e m e n t s
P a g e O b j e c t sP a g e O b j e c t s
S e l e n i u m
Tempo Project
Tempo – a story about time
Purpose of the application
Possible user scenarios – as acceptance tests
Structure considered for testing
Demo of the Tempo project
Identifying the page and panes objects for testing structure – Time Tracking page
Time Tracking
Page
Time Tracking Pane
Time List Pane
Tag Pane
Live View Pane
Tempo Project
Diagram of tempo test project
This is where QA designs the tests.
complex functionalities covering the usage of the application;
specific user scenario or a combination of possible user actions;
validation data in one or more test classes;
data driven testing, when needed.
DEV and partly QA
Pages - Java class for each page under test with the UI elements to be
verified and all methods that are used further in the tests;
Panes – Java classes for each panes identified in the pages and the
verifying methods for each action;
Common - generic functionality executed in more pages or all pages e.g.
navigation between all pages, cleaning/ preparing the database for tests,
auto login executed before testing any page, others.
Adapting Selenium
Elements: classes for basic HTML elements such as text field, check box,
radio button, etc that encourage OO test code);
Browser Driver: browser driver utility (class) that builds an abstraction layer
for selenium RC for controlling the browser (e.g. start, stop) and for
implementing user actions methods (e.g. click, type text);
Extending the element location strategy by Injecting the entire jQuery
framework into pages under test, in order to verify visibility of elements that
appear after dynamic HTML or Ajax calls.
Tempo Project
Use case: Open Time Tracking page and register the time in TEMPO application (time punch,
time stamps, interval, duration). Check the results on the page.
instantiate page object TimeTrackingPage and within it we:
instantiate TimeTrackingPane – create new time stamp
instantiate TimeListPane – test that a new time stamp is listed
Instantiate TagPane – test that the new tag is loaded and displayed
Instantiate LiveViewPane – test the duration totals
Demo of the automation tests – explanation of the test class.
Tempo Project
Questions
http://seleniumhq.org/
http://patrickwilsonwelsh.com
http://www.muranosoft.com/Outsourcingblog/How-To-Use-JQuery-Instead-Of-XPath-Locators
http://code.google.com/p/learning-codebases/source/browse/trunk/selenium-rc-patterns/
http://www.slideshare.net/dampy/selenium-204802
http://www.developerit.com/en/search/selenium-rc
http://stackoverflow.com/questions/1464606/selenium-rc-having-problems-with-xpath-for-a-ta
References
Monica Nanu
openForce Information Technology GesmbH
Dresdner Str. 108 / 3. Stock / Top 11
1200 Wien
TEL +43 1 3191775
FAX +43 1 3191775-20
www.openforce.com

More Related Content

PDF
Open Source Software Testing Tools
PDF
Test automation - Building effective solutions
PPT
Introduction to Selenium
PDF
Selenium - Introduction
ODP
Software testing tools
DOCX
Selenium notes
PPT
Selenium
PPT
Selenium
Open Source Software Testing Tools
Test automation - Building effective solutions
Introduction to Selenium
Selenium - Introduction
Software testing tools
Selenium notes
Selenium
Selenium

What's hot (19)

ODP
Selenium ppt
PDF
Web UI test automation instruments
PPTX
Introduction to Selenium Web Driver
PDF
Mastering Test Automation: How to Use Selenium Successfully
PPT
Software Testing - Tool support for testing (CAST) - Mazenet Solution
PPTX
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
PDF
Selenium webdriver interview questions and answers
PPTX
Types of test tools
PDF
Pragmatic Java Test Automation
PPT
Selenium2 and Jenkins: Almost pain-free UI Testing
PPT
Selenium
PDF
Software testing tools
ODP
Mastering selenium for automated acceptance tests
PDF
Selenium Handbook
PPT
Selenium Concepts
PDF
Advanced Selenium Workshop
PDF
Selenium Webdriver Interview Questions
PPT
Web Test Automation with Selenium
PPT
Selenium ppt
Selenium ppt
Web UI test automation instruments
Introduction to Selenium Web Driver
Mastering Test Automation: How to Use Selenium Successfully
Software Testing - Tool support for testing (CAST) - Mazenet Solution
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
Selenium webdriver interview questions and answers
Types of test tools
Pragmatic Java Test Automation
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium
Software testing tools
Mastering selenium for automated acceptance tests
Selenium Handbook
Selenium Concepts
Advanced Selenium Workshop
Selenium Webdriver Interview Questions
Web Test Automation with Selenium
Selenium ppt
Ad

Viewers also liked (13)

ODP
jQuery & CouchDB - Die zukünftige Webentwicklung?
DOCX
Spatial Perception
ODP
CouchApp - Build scalable web applications and relax
PPTX
Seks råd for å lykkes i arbeidslivet
ODP
node.js - Fast event based web application development
PPTX
Optimizing WordPress - WordPress SF Meetup April 2012
PDF
20 Tweetable Quotes to Inspire Marketing & Design Creative Genius
PDF
How to Craft Your Company's Storytelling Voice by Ann Handley of MarketingProfs
PDF
What REALLY Differentiates The Best Content Marketers From The Rest
PDF
Creating Powerful Customer Experiences
PDF
2015 Travel Trends
PPTX
All About Beer
PDF
Eco-nomics, The hidden costs of consumption
jQuery & CouchDB - Die zukünftige Webentwicklung?
Spatial Perception
CouchApp - Build scalable web applications and relax
Seks råd for å lykkes i arbeidslivet
node.js - Fast event based web application development
Optimizing WordPress - WordPress SF Meetup April 2012
20 Tweetable Quotes to Inspire Marketing & Design Creative Genius
How to Craft Your Company's Storytelling Voice by Ann Handley of MarketingProfs
What REALLY Differentiates The Best Content Marketers From The Rest
Creating Powerful Customer Experiences
2015 Travel Trends
All About Beer
Eco-nomics, The hidden costs of consumption
Ad

Similar to Web Testen mit Selenium (20)

DOCX
Selenium Testing Training in Bangalore
DOCX
Selenium interview-questions-freshers
DOCX
Software Testing Tools Training
PDF
What is Selenium Testing.pdf
PDF
Best Unit Testing Frameworks to Automate your Desktop Web Testing using Selen...
PDF
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
PDF
An Overview of Selenium Grid and Its Benefits
DOCX
What is selenium
PDF
Selenium Testing The Complete Step-by-Step Tutorial.pdf
PPTX
Smart acceptance GUI tests with Selenium
PPTX
Selenium WebDriver training
PPTX
Selenium test automation
PDF
Selenium Automation Testing Interview Questions And Answers
PPTX
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
PPT
Selenium Primer
PDF
Interview Question & Answers for Selenium Freshers | LearningSlot
PDF
International journal of applied sciences and innovation vol 2015 - no 1 - ...
PPT
Stepin evening presented
PPTX
Test automation using selenium
PPTX
Mastering Test Automation: How To Use Selenium Successfully
Selenium Testing Training in Bangalore
Selenium interview-questions-freshers
Software Testing Tools Training
What is Selenium Testing.pdf
Best Unit Testing Frameworks to Automate your Desktop Web Testing using Selen...
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
An Overview of Selenium Grid and Its Benefits
What is selenium
Selenium Testing The Complete Step-by-Step Tutorial.pdf
Smart acceptance GUI tests with Selenium
Selenium WebDriver training
Selenium test automation
Selenium Automation Testing Interview Questions And Answers
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
Selenium Primer
Interview Question & Answers for Selenium Freshers | LearningSlot
International journal of applied sciences and innovation vol 2015 - no 1 - ...
Stepin evening presented
Test automation using selenium
Mastering Test Automation: How To Use Selenium Successfully

Recently uploaded (20)

PPTX
Term review 2023 Hirata TYPHOON.pptx review
PPTX
PPT ARIEZ'S TOUR FINAL Pulogebang on.pptx
PPTX
Fashion Jewellery and Clothing Business.pptx
PDF
The Lifestyle Benefits and Challenges of Living Alone
PDF
John Baptist Scalabrini Novena - Fr Luciano Final eddition.pdf
PPTX
photography_basics_jdfjdbjdbjbfjdbj.pptx
PPTX
James 1 Bible verses sermonbbbbbbbbbb.pptx
PDF
Modern Furniture Trends & Home Interior Decoration
PDF
Economic and Financial Abuse - Hidden Tools of Power in Domestic Violence
PDF
Pranotsava Monsoon Retreat - Fazlani Nature's Nest
PPTX
Respiratory-and-Circulatory-Hazards-lecture.pptx
PDF
Echoes of Tomorrow - A Sustainable Legacy for Future Generations.pdf
DOC
AAMU毕业证学历认证,爱默生学院毕业证ps毕业证
PDF
The Top Life Coach in Haarlem is Life Coach Rudolfo.pdf
PDF
Non-Fatal Strangulation in Domestic Violence
DOC
AU毕业证学历认证,阿拉巴马大学亨茨维尔分校毕业证成绩单图片
PPTX
hhhsyysvwvsydxuguduehshsvdhvdjbuwbjwjdbwubs
PPTX
Benefits of Red Cyan Glasses - rdoptical.com.pptx
PDF
The Science-Backed Benefits of Fruit and Vegetable Extracts.pdf
PDF
Home science Resource management project
Term review 2023 Hirata TYPHOON.pptx review
PPT ARIEZ'S TOUR FINAL Pulogebang on.pptx
Fashion Jewellery and Clothing Business.pptx
The Lifestyle Benefits and Challenges of Living Alone
John Baptist Scalabrini Novena - Fr Luciano Final eddition.pdf
photography_basics_jdfjdbjdbjbfjdbj.pptx
James 1 Bible verses sermonbbbbbbbbbb.pptx
Modern Furniture Trends & Home Interior Decoration
Economic and Financial Abuse - Hidden Tools of Power in Domestic Violence
Pranotsava Monsoon Retreat - Fazlani Nature's Nest
Respiratory-and-Circulatory-Hazards-lecture.pptx
Echoes of Tomorrow - A Sustainable Legacy for Future Generations.pdf
AAMU毕业证学历认证,爱默生学院毕业证ps毕业证
The Top Life Coach in Haarlem is Life Coach Rudolfo.pdf
Non-Fatal Strangulation in Domestic Violence
AU毕业证学历认证,阿拉巴马大学亨茨维尔分校毕业证成绩单图片
hhhsyysvwvsydxuguduehshsvdhvdjbuwbjwjdbwubs
Benefits of Red Cyan Glasses - rdoptical.com.pptx
The Science-Backed Benefits of Fruit and Vegetable Extracts.pdf
Home science Resource management project

Web Testen mit Selenium

  • 1. Selenium Automation Testing with Selenium Wien, 21. Oktober, 2010 Monica Nanu
  • 2. Summary Selenium – General overview Risks and structuring the test project Showcase: Implementation for TEMPO
  • 3. Selenium – General Overview What is Selenium? The Selenium components Steps in developing automation tests Future development – Selenium 2.0
  • 4. Selenium is a suite of tools to automate web application testing across many platforms. What is Selenium Framework for automation testing tool for web applications IDE for record / playback → creation of tests → learning language DSL for writing test scripts in Java, Ruby and others Support for all major browsers Selenium components Selenium IDE Selenium Remote Control Selenium Grid Selenium – General Overview
  • 5. ● Steps: Selenium IDE: Record and playback Selenium IDE: Export as Java code Selenium RC: Execute Java(Eclipse-Junit) Selenium GRID: distribute on various environments Selenium – General Overview
  • 6. Selenium commands (Selenese) A set of commands that run the tests for a web- based application: check if the correct UI elements exist; check the specific content of the UI elements; check that all links are functional; check data entry field (input of data and check of the values); checks the option selection on different UI elements (radio buttons, check boxes, drop down lists); checks the form submit options; check for applications using Ajax calls. There are 3 Types of commands: Actions - commands that manage the state of the application “click link”, “select option”, Fail = the execution of the test case stops/ends, ...AndWait – a post-back is set and Selenium waits until the execution is completed Accessors – check the state of the variables that are used in Assert commands Assertions – check that the state of the aplication is exactly what and how is expected. E.g.. “the title of the page is ”abc” or that “checkbox is selected”. There are 3 methods to check: “assert” (the test stops), “verify”(error is logged and the test continues ) ” waitFor” (awaits until a restriction is aquired – used for testing applications with Selenium – General Overview
  • 7. Client library : Transforms the Java calls into server commands, by encoding it into the “Selenese” network protocol (on top of HTTP) and sending it to the Selenium server. E.g. “start browser”, “click-to”... Server component: Listens for commands from clients (on a TCP socket) and performs actions accordingly. E.g. starting web-browser or forwarding “user interaction” to the web-browser and delivering back the result to the client. Selenium – General Overview
  • 8. Speeds up functional testing of web-applications by leveraging the existing computing infrastructure; Allows easily running multiple tests in parallel, on multiple machines, in an heterogeneous environment; Allows running multiple instances of Selenium Remote Control in parallel. Even better, it makes all these Selenium Remote Controls appear as a single one, so the tests do not have to worry about the actual infrastructure; Selenium Grid cuts down on the time required to run a Selenium test suite to a fraction of the time that a single instance of Selenium instance would take to run. Selenium – General Overview
  • 9. Strong Points: Open source tool for web application (no license costs, large community for support and cont. dev.); support for multi platform and multi browser in terms of coverage; DOM testing – simple and strong; The TC are stable, for mature versions; Supports testing AJAX applications; Allows building flexible testing scenarios within the power of Java. Weak Points: Error diagnoze and reporting; Upon UI changes, the scripts need update (general for all automation tools); It is state dependent (html driven); May require more knowledge (learning effort may be high in the beginning). Future and actual Selenium projects: Selenium 2.0 (Selenium + WebDriver) Drivers: HtmlUnit / Firefox / IE / Chrome Selenium – review
  • 10. Starting point: Test Plan Functionality tree and initial evaluation of total effort (main functionalities and test cases) Manual versus Automation testing Risk evaluation Decision for the solution of automation testing GUI and usability Performance Regressions and others Main risks to evaluate for automation: No automation - The quality of the testing and the time invested The cost of development and maintenance of the automated tests Result: We implement the automation testing in a structured layered architecture using Selenium Selenium – review
  • 11. Test Project Structure Working together with Development and QA to implement the test framework structure. separate test-framework code from the actual tests classes separating reusable, generic test-framework code from a project specific code QA Dev T e s t c l a s s e s L o g i n M o d u l e 1 M o d u l e 2 C o m m o n T e s t c l a s s e s L o g i nL o g i n M o d u l e 1M o d u l e 1 M o d u l e 2M o d u l e 2 C o m m o nC o m m o n P r o j e c t s p e c i f i c f r a m e w o r k P a g e 1 - n P a n e 1 - n C o m m o n O t h e r . . . P r o j e c t s p e c i f i c f r a m e w o r k P a g e 1 - nP a g e 1 - n P a n e 1 - nP a n e 1 - n C o m m o nC o m m o n O t h e r . . .O t h e r . . . TestFramework UtilProjectTestcases TestFramework UtilUtilProjectProjectTestcasesTestcases ) B D r i v e r H T M L E l e m e n t s P a g e O b j e c t s ) B D r i v e rB D r i v e r H T M L E l e m e n t s H T M L E l e m e n t s P a g e O b j e c t sP a g e O b j e c t s S e l e n i u m
  • 12. Tempo Project Tempo – a story about time Purpose of the application Possible user scenarios – as acceptance tests Structure considered for testing Demo of the Tempo project
  • 13. Identifying the page and panes objects for testing structure – Time Tracking page Time Tracking Page Time Tracking Pane Time List Pane Tag Pane Live View Pane Tempo Project
  • 14. Diagram of tempo test project This is where QA designs the tests. complex functionalities covering the usage of the application; specific user scenario or a combination of possible user actions; validation data in one or more test classes; data driven testing, when needed. DEV and partly QA Pages - Java class for each page under test with the UI elements to be verified and all methods that are used further in the tests; Panes – Java classes for each panes identified in the pages and the verifying methods for each action; Common - generic functionality executed in more pages or all pages e.g. navigation between all pages, cleaning/ preparing the database for tests, auto login executed before testing any page, others. Adapting Selenium Elements: classes for basic HTML elements such as text field, check box, radio button, etc that encourage OO test code); Browser Driver: browser driver utility (class) that builds an abstraction layer for selenium RC for controlling the browser (e.g. start, stop) and for implementing user actions methods (e.g. click, type text); Extending the element location strategy by Injecting the entire jQuery framework into pages under test, in order to verify visibility of elements that appear after dynamic HTML or Ajax calls. Tempo Project
  • 15. Use case: Open Time Tracking page and register the time in TEMPO application (time punch, time stamps, interval, duration). Check the results on the page. instantiate page object TimeTrackingPage and within it we: instantiate TimeTrackingPane – create new time stamp instantiate TimeListPane – test that a new time stamp is listed Instantiate TagPane – test that the new tag is loaded and displayed Instantiate LiveViewPane – test the duration totals Demo of the automation tests – explanation of the test class. Tempo Project
  • 18. Monica Nanu openForce Information Technology GesmbH Dresdner Str. 108 / 3. Stock / Top 11 1200 Wien TEL +43 1 3191775 FAX +43 1 3191775-20 www.openforce.com

Editor's Notes

  • #7: I show here the IDE in Firefox – how it functions for a login page and the generated java file.