Anda di halaman 1dari 17

Selenium Basics Workshop

Frank Cohen, +01 (408) 871-0122, fcohen@pushtotest.com

April 20, 2011


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
Environment
TestMaker Tests Into Your Continuous Integration

How To Analyze Test Results Into Actionable Knowledge

3
Open Source Test Automation

Manual Testing Process


Results

4 1

Recommend Changes
Explore
Manual
Testing

Tes
3 t
2 Plan

4 Run The Test Steps


Create Test Plans
Open Source Test Automation

Side Effects
Exhaustion
Fatigue
Blurry Vision
Night Sweats
Insanity
Hair Loss
Acne
Divorce
5
Open Source Test Automation

OST Architecture
Application Under Test PTTMonitor
Web, RIA, BPM, SOA CPU, Net, Memory

Functional
Test Injector Test Authoring
Test
Bundles ScriptRunners Data Production Libraries SoapUI (Pro)
MySQL, HtmlUnit Sahi, Selenium, SoapUI, Java csv files, rdbms queries Sahi (Pro)
JUnit Class Framework
Load Test Eclipse Java IDE
Fitness
Test Operation Console Languages: Java, Python
Wiki Collaboration

Production Designer Grid and Cloud Repository Results Analysis


Record/Playback Test Deployment MySQL RDBMS Business Intelligence Tool
Monitor

Continuous Test
Repository Bug Tracker Monitoring
Integration Management

6
Open Source Test Automation

Selenium Browser Automation


Selenium Core
Selenium RC
Selenium Grid
Selenium IDE
Selenium Domain Specific Language (DSL)

7
Open Source Test Automation

Selenium Architecture
Selenium 1 Selenium 2 (WebDriver)

Browser Browser

iFrame Browser API


Selenium Client Selenium RC Selenium Client Selenium Server
Browserbot Application
Under Test
Application
(AUT)
Under Test
(AUT) DOM
DOM
Javascript
Javascript

8
Open Source Test Automation

Selenium Language Basics


Page Commands
Element Commands
Validation Commands
Assertion Commands
Storage Commands

9
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
10
css=input.required[type="text"]
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
Do Dont
Components Pause
Record -> Script Use Static Values
Dynamic Locators Storage Values
Work With Devs Test and Trash
Events Expect The Same

12
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/
public void sumForValidNumbers() {
flexUITester.type("2").at("arg1");
flexUITester.type("3").at("arg2");
flexUITester.click("submit");
assertEquals("5", flexUITester.readFrom("result"));
}

Flex Automation API - Flexmonkium


13
Open Source Test Automation

TestMaker and Selenium


Application Under Test

TestNode
Selenium RC SeleniumHtmlUnit

Selenese Test

TestMaker Console

14
Open Source Test Automation

TestMaker Object Designer


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

15
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, sales@pushtotest.com
17

Anda mungkin juga menyukai