SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instrumentsArtem Nagornyi
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Applitools
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionSoftware Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionMazenetsolution
 
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...Trójmiejska Grupa Testerska
 
Selenium webdriver interview questions and answers
Selenium webdriver interview questions and answersSelenium webdriver interview questions and answers
Selenium webdriver interview questions and answersITeLearn
 
Types of test tools
Types of test toolsTypes of test tools
Types of test toolsVaibhav Dash
 
Pragmatic Java Test Automation
Pragmatic Java Test AutomationPragmatic Java Test Automation
Pragmatic Java Test AutomationDmitry Buzdin
 
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI TestingSelenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI Testingmikereedell
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsNick Belhomme
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium WorkshopClever Moe
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsJai Singh
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 

La actualidad más candente (19)

Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet SolutionSoftware Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet Solution
 
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
 
Selenium webdriver interview questions and answers
Selenium webdriver interview questions and answersSelenium webdriver interview questions and answers
Selenium webdriver interview questions and answers
 
Types of test tools
Types of test toolsTypes of test tools
Types of test tools
 
Pragmatic Java Test Automation
Pragmatic Java Test AutomationPragmatic Java Test Automation
Pragmatic Java Test Automation
 
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI TestingSelenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI Testing
 
Selenium
SeleniumSelenium
Selenium
 
Software testing tools
Software testing toolsSoftware testing tools
Software testing tools
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
Selenium Handbook
Selenium HandbookSelenium Handbook
Selenium Handbook
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Advanced Selenium Workshop
Advanced Selenium WorkshopAdvanced Selenium Workshop
Advanced Selenium Workshop
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview Questions
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 

Destacado

Seks råd for å lykkes i arbeidslivet
Seks råd for å lykkes i arbeidslivetSeks råd for å lykkes i arbeidslivet
Seks råd for å lykkes i arbeidslivetStian T.
 
Optimizing WordPress - WordPress SF Meetup April 2012
Optimizing WordPress -  WordPress SF Meetup April 2012Optimizing WordPress -  WordPress SF Meetup April 2012
Optimizing WordPress - WordPress SF Meetup April 2012Ben Metcalfe
 
20 Tweetable Quotes to Inspire Marketing & Design Creative Genius
20 Tweetable Quotes to Inspire Marketing & Design Creative Genius20 Tweetable Quotes to Inspire Marketing & Design Creative Genius
20 Tweetable Quotes to Inspire Marketing & Design Creative GeniusIMPACT Branding & Design LLC
 
How to Craft Your Company's Storytelling Voice by Ann Handley of MarketingProfs
How to Craft Your Company's Storytelling Voice by Ann Handley of MarketingProfsHow to Craft Your Company's Storytelling Voice by Ann Handley of MarketingProfs
How to Craft Your Company's Storytelling Voice by Ann Handley of MarketingProfsMarketingProfs
 
What REALLY Differentiates The Best Content Marketers From The Rest
What REALLY Differentiates The Best Content Marketers From The RestWhat REALLY Differentiates The Best Content Marketers From The Rest
What REALLY Differentiates The Best Content Marketers From The RestRoss Simmonds
 
Creating Powerful Customer Experiences
Creating Powerful Customer ExperiencesCreating Powerful Customer Experiences
Creating Powerful Customer ExperiencesDigital Surgeons
 
All About Beer
All About Beer All About Beer
All About Beer Ethos3
 
Eco-nomics, The hidden costs of consumption
Eco-nomics, The hidden costs of consumptionEco-nomics, The hidden costs of consumption
Eco-nomics, The hidden costs of consumptionJosh Beatty
 

Destacado (13)

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

Similar a Web Testen mit Selenium

Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalorerajkamal560066
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshersNaga Mani
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools TrainingQEdge Tech
 
What is Selenium Testing.pdf
What is Selenium Testing.pdfWhat is Selenium Testing.pdf
What is Selenium Testing.pdfAnanthReddy38
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfMinh Quân Đoàn
 
Smart acceptance GUI tests with Selenium
Smart acceptance GUI tests with SeleniumSmart acceptance GUI tests with Selenium
Smart acceptance GUI tests with SeleniumDenys Zaiats
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automationSrikanth Vuriti
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...DevDay.org
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotLearning Slot
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...sophiabelthome
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presentedVijayan Reddy
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
What is Selenium Introduction to Selenium Testing.pptx
What is Selenium Introduction to Selenium Testing.pptxWhat is Selenium Introduction to Selenium Testing.pptx
What is Selenium Introduction to Selenium Testing.pptxSyntax Technologies
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using SeleniumNikhil Kapoor
 

Similar a Web Testen mit Selenium (20)

Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshers
 
Software Testing Tools Training
Software Testing Tools TrainingSoftware Testing Tools Training
Software Testing Tools Training
 
What is Selenium Testing.pdf
What is Selenium Testing.pdfWhat is Selenium Testing.pdf
What is Selenium Testing.pdf
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
 
What is selenium
What is seleniumWhat is selenium
What is selenium
 
Smart acceptance GUI tests with Selenium
Smart acceptance GUI tests with SeleniumSmart acceptance GUI tests with Selenium
Smart acceptance GUI tests with Selenium
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automation
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
 
Selenium Primer
Selenium PrimerSelenium Primer
Selenium Primer
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
What is Selenium Introduction to Selenium Testing.pptx
What is Selenium Introduction to Selenium Testing.pptxWhat is Selenium Introduction to Selenium Testing.pptx
What is Selenium Introduction to Selenium Testing.pptx
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
Selenium and JMeter
Selenium and JMeterSelenium and JMeter
Selenium and JMeter
 

Último

Boys Wholesale Clothing Online | Port 213
Boys Wholesale Clothing Online | Port 213Boys Wholesale Clothing Online | Port 213
Boys Wholesale Clothing Online | Port 213Port 213
 
The Heirloom Gown: A Tale of Love and Legacy
The Heirloom Gown: A Tale of Love and LegacyThe Heirloom Gown: A Tale of Love and Legacy
The Heirloom Gown: A Tale of Love and Legacyirumsohale
 
Alex Gurkin: Strategies for a Sustainable Tech Career
Alex Gurkin: Strategies for a Sustainable Tech CareerAlex Gurkin: Strategies for a Sustainable Tech Career
Alex Gurkin: Strategies for a Sustainable Tech CareerAlex Gurkin
 
Beyond Academics - Anibal Romero .pdf
Beyond Academics - Anibal Romero    .pdfBeyond Academics - Anibal Romero    .pdf
Beyond Academics - Anibal Romero .pdfroberttianibal
 
Bridging Cultures: Antique Indian Doors with Mediterranean Arches
Bridging Cultures: Antique Indian Doors with Mediterranean ArchesBridging Cultures: Antique Indian Doors with Mediterranean Arches
Bridging Cultures: Antique Indian Doors with Mediterranean ArchesEra Chandok
 
Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...
Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...
Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...Newsroom8
 
HVAC Replacement Process for Commercial Buildings Guide
HVAC Replacement Process for Commercial Buildings GuideHVAC Replacement Process for Commercial Buildings Guide
HVAC Replacement Process for Commercial Buildings Guideoutreachacdirect
 
Secrets for A Happy Relationship & Marriage.
Secrets for A Happy Relationship & Marriage.Secrets for A Happy Relationship & Marriage.
Secrets for A Happy Relationship & Marriage.Surajkurrey
 

Último (8)

Boys Wholesale Clothing Online | Port 213
Boys Wholesale Clothing Online | Port 213Boys Wholesale Clothing Online | Port 213
Boys Wholesale Clothing Online | Port 213
 
The Heirloom Gown: A Tale of Love and Legacy
The Heirloom Gown: A Tale of Love and LegacyThe Heirloom Gown: A Tale of Love and Legacy
The Heirloom Gown: A Tale of Love and Legacy
 
Alex Gurkin: Strategies for a Sustainable Tech Career
Alex Gurkin: Strategies for a Sustainable Tech CareerAlex Gurkin: Strategies for a Sustainable Tech Career
Alex Gurkin: Strategies for a Sustainable Tech Career
 
Beyond Academics - Anibal Romero .pdf
Beyond Academics - Anibal Romero    .pdfBeyond Academics - Anibal Romero    .pdf
Beyond Academics - Anibal Romero .pdf
 
Bridging Cultures: Antique Indian Doors with Mediterranean Arches
Bridging Cultures: Antique Indian Doors with Mediterranean ArchesBridging Cultures: Antique Indian Doors with Mediterranean Arches
Bridging Cultures: Antique Indian Doors with Mediterranean Arches
 
Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...
Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...
Oι πιο ευτυχισμένες και οι πιο δυστυχισμένες χώρες: Πρωτιά για τη Φινλανδία -...
 
HVAC Replacement Process for Commercial Buildings Guide
HVAC Replacement Process for Commercial Buildings GuideHVAC Replacement Process for Commercial Buildings Guide
HVAC Replacement Process for Commercial Buildings Guide
 
Secrets for A Happy Relationship & Marriage.
Secrets for A Happy Relationship & Marriage.Secrets for A Happy Relationship & Marriage.
Secrets for A Happy Relationship & Marriage.
 

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

Notas del editor

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