Functional Testing Using Selenium and .What is Selenium Selenium Grid enables you to distribute your

  • View

  • Download

Embed Size (px)

Text of Functional Testing Using Selenium and .What is Selenium Selenium Grid enables you to distribute your

Functional Testing

Using Selenium

and ColdFusion

Our Agenda What is Functional Testing?

What is Selenium?

Introducing the Selenium IDE

Creating and Running Tests

Using TestRunner

Dynamic Tests Using ColdFusion

Additional Resources

Me: Theo Rushin, Jr. (

Senior Web Application Developer

@ TwinTechnologies

Application Developer and Trainer Since 85

ColdFusion Developer Since 99

Flash Developer Since 99

Flex Developer Since 05

Deploying Flex applications to AIR Since 07

Christian, husband, father, magician, snowboarder,



What is Functional TestingAn Overview

It is the purpose of the functional testing to identify test cases that can be used to prove that the corresponding functionality is available and can be executed as well.

It involves running a suite of tests on the completed system.

Each individual test, known as a case, exercises a particular operating condition of the user's environment or feature of the system.

These tests result in a pass or fail outcome.

What is Functional TestingWhy test?

The objective is to provide confidence that the

delivered system meets the business

requirements of both sponsors and users.

Proper testing can focus the discussion on the

problem, instead of the people - The problem

may be with the software and/or environment

and not with the person and/or organization.

What is SeleniumAn Overview

Selenium is a suite of tools used to automate web application testing across many platforms.

Selenium IDE

Selenium Remote Control (RC)

Selenium Grid

What is SeleniumSelenium IDE

is a Firefox extension that enables you to record, edit, and debug tests.

Its a complete IDE!

These tests can then be played back in the browser.

Selenium IDE contains the Selenium Core, the original Javascript-based testing system.

Although Selenium Core can also be used as a pure Javascript/HTML testing system, it is primarily used as a component of the Selenium IDE and the Selenium Remote Control.

What is SeleniumSelenium Remote Control (RC)

allows you to write automated web application tests in

any programming language.

Selenium Remote Control is a java-based server.

This is an ideal solution for those who want to write

tests in a more expressive programming language

What is SeleniumSelenium Grid

enables you to distribute your tests on multiple

machines so that you can run your tests in parallel.

Selenium Grid is a java-based server.

Think of it as a distributed grid of Selenium Remote

Controls that we could easily be shared across

builds, applications, and projects.



Record and

play back


Save test scripts in various


What is SeleniumConcepts

Commands tells Selenium what to do.

Selenium commands come in three

flavors: Actions, Accessors and


Each command call is one line in the

test table.

command target value

What is SeleniumActions

are commands that generally manipulate the

state of the application.

They do things like "click this link" and "select

that option".

If an Action fails, or has an error, the

execution of the current test is stopped.

What is SeleniumAssertions

verify that the state of the application

conforms to what is expected

Examples include:

make sure the page title is

verify that a checkbox is checked.

What is SeleniumAssertions (cont.)

All Selenium Assertions can be used in 3 modes: assert, verify, and waitFor

verify and assert assertions are used to test form field values, labels, etc.

When an assert fails, the test is aborted.

When a verify fails, the test will continue execution, logging the failure.

waitFor commands wait for some condition to become true.

waitFor assertions will fail and halt the test if the condition does not become true within the current timeout setting

What is SeleniumAccessors

examine the state of the application and store

the results in variables, e.g. "storeTitle

They are also used to automatically generate


For example, the storeAlert Accessor

automatically generates the following Assertions:

assertAlert(), assertNotAlert(), verifyAlert(),

verifyNotAlert(), waitForAlert(), waitForNotAlert()

What is SeleniumExample HTML Test Script

New Test

New Test








Command to open to a

specific URL

Command to type the

word selenium

Command to click on the

Search button and wait.

What is SeleniumElement Locators

tell Selenium which HTML element a command refers to.

The following strategies for locating elements are supported







css=sccSelector Syntax

What is SeleniumPatterns

can be used in actions, accessors, and locators, they

include regular-expressions.

What is SeleniumVariables

... can be javascript or simple variables. Stored

Variables are referenced through Selenium

commands. Substitution Variables are called like


Introducing the Selenium IDEOverview

Easily record and playback tests.

Intelligent field selection will use IDs, names, or XPath as needed.

Autocomplete for all common Selenium commands.

Step through tests.

Debug and set breakpoints.

Save tests as HTML, Ruby scripts, or any other format.

Support for Selenium user-extensions.js file.

Option to automatically assert the title of every page.

Introducing the Selenium IDEOverview (cont.)

Creating and Running TestsA Demonstration

Record a Test Script

Run the Test Script

Step Through the Test Script

Debug the Test Script

Using TestRunnerAn Overview

Selenium TestRunner enables you to automate the execution of test scripts.

The Selenium Core code, the tests, and the web application to be tested all reside under the web server's document root.

Used without the Selenium IDE.

Use the TestRunner URL in a browser with an argument pointing to the tests.

The tests are read and TestRunner sends Javascript to the browser to execute them.

Using TestRunnerA Demonstration

URL Syntax:





Dynamic Tests Using ColdFusionA Demonstration

Note: This strategy does not use the

Selenium Remote Control.

Use CFQuery to retrieve values from a


Provide calculated values.

Additional Resources


Selenium Reference:


Selenium Forum: