web test automation with selenium 21055
TRANSCRIPT
-
8/8/2019 Web Test Automation With Selenium 21055
1/16
ThoughtWorks, 2006
Web Test Automation with Selenium
Vivek Prahlad
-
8/8/2019 Web Test Automation With Selenium 21055
2/16
ThoughtWorks, 2006 2
Agenda
Introduction to Selenium
Demo
An overview of the framework, and how it works
Showcase the different ways of using Selenium
FIT style tables
Selenium Remote Control (RC)
Limitations of Selenium
-
8/8/2019 Web Test Automation With Selenium 21055
3/16
ThoughtWorks, 2006 3
What is Selenium?
A JavaScript based
Open Source
Web testing tool
That supports testing Web 2.0 applications
On multiple browsers
And multiple Operating Systems
-
8/8/2019 Web Test Automation With Selenium 21055
4/16
ThoughtWorks, 2006
Quick Demo
-
8/8/2019 Web Test Automation With Selenium 21055
5/16
ThoughtWorks, 2006 5
Overview
History: originated from TW Time Sheet application
Extremely popular Open Source Web testing tool
Can be used for Acceptance / Functional testing
Can be used for reproducing bugs
-
8/8/2019 Web Test Automation With Selenium 21055
6/16
ThoughtWorks, 2006 6
Using Selenium
Bot mode: Selenium Core
HTML Tables
Driven mode: Selenium Remote Control (RC)
Test cases in language of choice
Record mode: Selenium IDE
-
8/8/2019 Web Test Automation With Selenium 21055
7/16
ThoughtWorks, 2006
Architecture
-
8/8/2019 Web Test Automation With Selenium 21055
8/16
ThoughtWorks, 2006 8
Table or driver based?
Table based approach fine for simple tests.
No programming required
Doesn't scale duplication is a major issue.
Driver approach better for 'Real' test suites
Can develop tests in language of choice:
C#, Java, Ruby, Python, Perl
Easier data management via DB / Excel
-
8/8/2019 Web Test Automation With Selenium 21055
9/16
ThoughtWorks, 2006 9
Maintaining Test Suites
Test code is just like production code!
Needs refactoring, abstraction
API for the application
Can build tests from API building blocks
Try to maintain meaning in test names, variable
names, comments, and suite organization
-
8/8/2019 Web Test Automation With Selenium 21055
10/16
ThoughtWorks, 2006 10
Evolving Test Suites
Do your test suites break as the app evolves?
The importance of DRY: Don't Repeat Yourself
Minimize changes to test suite as app changes
Avoid redoing / reworking entire test suites
Avoiding duplication simpler for test code: test steps
execute sequentially
Methods, parametrization
To some extent, Object Orientation
-
8/8/2019 Web Test Automation With Selenium 21055
11/16
ThoughtWorks, 2006
Demo: Refactoring Tests
-
8/8/2019 Web Test Automation With Selenium 21055
12/16
ThoughtWorks, 2006 12
Ajax support
Selenium supports testing Web 2.0 applications
Monitor the DOM for completion of Async calls
waitForCondition()
waitForValue()
-
8/8/2019 Web Test Automation With Selenium 21055
13/16
ThoughtWorks, 2006 13
Continuous Integration
Run Selenium tests as part of the build
Works with both Core and Driven modes
(Each time a developer checks in, if necessary)
Can generate HTML reports, published to entire team
Helps catch bugs ASAP
Addresses risk of catching bugs late in the cycle
-
8/8/2019 Web Test Automation With Selenium 21055
14/16
ThoughtWorks, 2006 14
Limitations
Most limitations valid if using Selenium Core:
Alerts
Same Origin Policy
File uploads
-
8/8/2019 Web Test Automation With Selenium 21055
15/16
ThoughtWorks, 2006 15
Summary
Selenium is a testing framework for Web Applications
Drivers allow web testing in language of choice
Test scripts are code: need maintenance, refactoring
Limitations of Selenium
-
8/8/2019 Web Test Automation With Selenium 21055
16/16
ThoughtWorks, 2006 16
Thank You!
Check out Selenium at:http://www.openqa.org/selenium
Questions?