selenium basics tutorial
DESCRIPTION
Selenium is a software testing framework for automating tests of Web applications. Join Frank Cohen for a Workshop to learn the basics of Selenium. A screencast for this presentation is on the PushToTest.com Web site.TRANSCRIPT
Open Source Test Automation
About PushToTest‣Our Mission: Test, To Make A More Reliable World
‣Make It Easier To Move From Manual To Automated Testing
‣Support Advanced Testing, including Agile, Load, Integration
‣Open Source Testing (OST) For Everyone
2
Open Source Test Automation
Today‣How To Use Selenium in Rich Internet Application (RIA, using Ajax)
Environments
‣How To Data Enable Selenium Tests Using TestMaker
‣Testing in Flash/Flex Environments Using AMF Protocols
‣ Integrating TestMaker Tests Into Your Continuous Integration Environment
‣How To Analyze Test Results Into Actionable Knowledge
3
Open Source Test Automation
Manual Testing Process
4
Manual
Testing
Explore
1
2
Test Plan
Create Test Plans
Run The Test Steps
3
4
Results
Recommend Changes
Open Source Test Automation
Side Effects
5
‣Exhaustion
‣Fatigue
‣Blurry Vision
‣Night Sweats
‣ Insanity
‣Hair Loss
‣Acne
‣Divorce
Open Source Test Automation
OST Architecture
6
Functional
Test
Production
Monitor
Load Test
Continuous Integration
Repository Bug TrackerTest
ManagementMonitoring
Test Authoring
SoapUI (Pro)
Sahi (Pro)
JUnit Class Framework
Eclipse Java IDE
Fitness
Languages: Java, Python
Wiki Collaboration
Application Under TestWeb, RIA, BPM, SOA
PTTMonitorCPU, Net, Memory
Test Injector
BundlesMySQL, HtmlUnit
ScriptRunnersSahi, Selenium, SoapUI, Java
Data Production Librariescsv files, rdbms queries
Test Operation Console
RepositoryMySQL RDBMS
Results AnalysisBusiness Intelligence Tool
DesignerRecord/Playback
Grid and CloudTest Deployment
Open Source Test Automation
Selenium Browser Automation
7
‣Selenium Core
‣Selenium RC
‣Selenium Grid
‣Selenium IDE
‣Selenium Domain Specific Language (DSL)
Open Source Test Automation
Selenium Architecture
8
Selenium ClientiFrame
Application
Under Test
(AUT)
Browserbot
DOM
Javascript
Browser
Selenium RC
Selenium 1 Selenium 2 (WebDriver)
Selenium ClientApplication Under Test
(AUT)
DOM
Javascript
Browser
Selenium Server Browser API
Open Source Test Automation
Selenium Language Basics
9
‣Page Commands
‣Element Commands
‣Validation Commands
‣Assertion Commands
‣Storage Commands
Open Source Test Automation
Selenium Locators‣ Identifiers
‣ loginForm
‣ id=loginForm
‣name=loginForm
‣XPath (1.0 from W3C, no support of 2.0 and XQuery)
‣Link Locator
‣ link=Continue <a href=”myurl”>Continue</a>
‣DOM APIs
‣dom=document.getElementById('loginForm')
‣CSS Selectors
‣css=input.required[type="text"]10
Open Source Test Automation
Event Handling and Ajax‣Selenium Tests Are Event Oriented
‣Not Timing Oriented
‣Ajax Web Objects
‣Complicated Structures
‣Dynamic Values
‣Asynchronous Events
‣No Standards
‣Ajax Example
11
Open Source Test Automation
We Recommend
12
ComponentsRecord -> Script
Dynamic LocatorsWork With Devs
Events
PauseUse Static ValuesStorage ValuesTest and Trash
Expect The Same
Do Don’t
Open Source Test Automation
Flex, Flash Testing‣Extend the Selenium RC clients for adding Flash communication
‣http://code.google.com/p/flex-ui-selenium/
‣http://code.google.com/p/flash-selenium/
‣Flex Automation API - Flexmonkium
13
public void sumForValidNumbers() { flexUITester.type("2").at("arg1"); flexUITester.type("3").at("arg2"); flexUITester.click("submit"); assertEquals("5", flexUITester.readFrom("result")); }
Open Source Test Automation
TestMaker and Selenium
14
Application Under Test
TestMaker Console
TestNode
Selenese Test
Selenium RC SeleniumHtmlUnit
Open Source Test Automation
TestMaker Object Designer
15
‣Point-and-Click Functional Test Record/Playback
‣Record Tests In IE, Chrome, Firefox, Safari, Opera
‣Automatic Ajax Synchronization
‣Drag-and-Drop Data Driven Testing
‣Creates Selenium, Sahi, and Flex Tests
Open Source Test Automation
Resources‣http://www.pushtotest.com/
‣http://seleniumhq.org
‣http://selenium.pushtotest.com
‣http://refcardz.dzone.com/refcardz/getting-started-selenium
‣http://refcardz.dzone.com/refcardz/getting-started-selenium-20
‣http://www.pushtotest.com/products-comparison
‣http://www.pushtotest.com/selenium-conference-2011-analysis
‣http://www.slideshare.net/frankcohen/selenium-xpath-performance-problems-in-ie
16
Open Source Test Automation
Where To Go From Here‣Watch A Screencast and Tutorial
‣http://www.pushtotest.com/screencastcentral
‣The Selenium Tutorial for Beginners
‣http://www.pushtotest.com/selenium-webinar-series
‣Attend An Open Source Test Workshop
‣http://workshop.pushtotest.com
‣Ask For A Proposal on Licenses, Training, Support, Consulting
‣Call +01 408 871 0122, [email protected]
17