Selenium 1.0 Testing Tools: Beginner’s Guide


Selenium 1.0 Testing Tools: Beginner’s Guide
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
$20.39
save 15%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
$39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Save your valuable time by using Selenium to record, tweak and replay your test scripts
  • Get rid of any bugs deteriorating the quality of your web applications
  • Take your web applications one step closer to perfection using Selenium tests
  • Packed with detailed working examples that illustrate the techniques and tools for debugging

Book Details

Language : English
Paperback : 232 pages [ 235mm x 191mm ]
Release Date : November 2010
ISBN : 1849510261
ISBN 13 : 9781849510264
Author(s) : David Burns
Topics and Technologies : All Books, App Testing, Web Development, Java, Open Source, Web Development, Web Services


Table of Contents

Preface
Chapter 1: Getting Started with Selenium IDE
Chapter 2: Locators
Chapter 3: Pattern Matching
Chapter 4: Using JavaScript
Chapter 5: User Extensions and Add-ons
Chapter 6: First Steps with Selenium RC
Chapter 7: Creating Selenium Remote Control Tests
Chapter 8: Advanced Selenium Techniques
Chapter 9: Getting Started with Selenium Grid
Chapter 10: Running Selenium Tests in Parallel
Chapter 11: Getting Started with Selenium 2
Pop Quiz Answers
Index
  • Chapter 1: Getting Started with Selenium IDE
    • Important preliminary points
    • What is Selenium IDE
    • Time for action – installing Selenium IDE
    • Selenium IDE
      • Selenium IDE icons
    • Important note
    • Time for action – recording your first test with Selenium IDE
    • Updating a test to assert items are on the page
    • Time for action – updating a test to verify items on the page
      • Comments
    • Time for action – adding Selenium IDE comments
    • Multiple windows
    • Time for action – working with multiple windows
    • Time for action – switching between multiple windows
    • Selenium tests against AJAX applications
    • Time for action – working on pages with AJAX
    • Time for action – working with AJAX applications
      • Storing information from the page in the test
    • Time for action – storing elements from the page
      • Debugging tests
    • Time for action – debugging tests
      • Test suites
    • Time for action – creating test suites
    • Saving tests
    • What you cannot record
    • Summary
  • Chapter 2: Locators
    • Important preliminary points
    • Locating elements by ID
    • Time for action – finding IDs of elements on the page with Firebug
    • Time for action – finding elements by ID
    • Moving elements on the page
    • Time for action – finding elements by name
    • Adding filters to the name
    • Time for action – finding elements by link text
    • Time for action – finding elements by accessing the DOM through JavaScript
    • Time for action – finding elements by XPath
      • Using direct XPath in your test
      • Using XPath to find the nth element of a type
      • Using element attributes in XPath queries
      • Doing a partial match on attribute content
      • Finding an element by the text it contains
      • Using XPath axis to find elements
    • CSS selectors
    • Time for action – finding elements by CSS
      • Using child nodes to find the element
      • Using sibling nodes to find the element
      • Using CSS class attributes in CSS selectors
      • Using element IDs in CSS selectors
      • Finding elements by their attributes
      • Partial matches on attributes
      • Finding the nth element with CSS
      • Finding an element by its inner text
    • Summary
  • Chapter 3: Pattern Matching
    • Verifying exact text
    • Time for action – verifying text
    • Time for action – using exact: on links
    • Using globs in our tests
    • Time for action – using globs in tests
    • Time for action – using * to find a basic pattern
    • Time for action – using ? in a glob pattern
    • Time for action – using character classes in globbing
    • Using regular expressions
    • Time for action – using basic regular expressions to check the date
    • Time for action – using regular expression wildcards
    • Summary
  • Chapter 4: Using JavaScript
    • Using JavaScript as our test language
    • Time for action – using JavaScript to enter text into a field
    • Time for action – using multiple statements in your JavaScript
    • Time for action – storing the result of JavaScript in a variable
    • Using Selenium variables with JavaScript
    • Time for action – using Selenium variables with JavaScript
    • Time for action – JavaScript within a verify or assert
    • Accessing the browser with JavaScript
    • Time for action – accessing the page with browserbot
    • Time for action – verifying a JavaScript evaluation with browserbot
    • Time for action – using waitForCondition
    • Firing events
    • Time for action – firing a mouseOver event
    • Time for action – firing an onBlur event in Selenium
    • Summary
  • Chapter 5: User Extensions and Add-ons
    • Important preliminary points
    • User extensions
    • Time for action – installing a user extension
    • Time for action – using Selenium variables in extensions
    • Time for action – using locators in extensions
    • Time for action – using browserbot from within an extension
    • Time for action – creating new commands to verify or assert
    • Add-ons
    • Time for action – creating a basic add-on
    • Summary
  • Chapter 6: First Steps with Selenium RC
    • Important preliminary points
    • What is Selenium Remote Control
    • Setting up Selenium Remote Control
    • Time for action – setting up Selenium Remote Control
    • Running Selenium IDE tests with Selenium Remote Control
    • Time for action – running Selenium IDE tests with Selenium
    • Remote Control
      • Running your Selenium IDE tests in Internet Explorer
    • Time for action – running our tests in Internet Explorer
      • Running your Selenium IDE tests in Google Chrome
    • Time for action – running Selenium IDE tests within Google Chrome
      • Running your Selenium IDE tests with the User Extensions
    • Time for action – running Selenium IDE tests with User Extensions
    • Selenium Remote Control arguments
    • Summary
  • Chapter 7: Creating Selenium Remote Control Tests
    • Important preliminary points
    • Converting Selenium IDE tests to a programming language
    • Time for action – converting Selenium IDE tests to a language
    • Writing Selenium tests from scratch
    • Time for action – creating a Selenium instance with JUnit 3
    • Time for action – creating a Selenium instance with SeleneseTestCase setUp()
    • Time for action – creating a Selenium instance with JUnit 4
    • Time for action – creating a Selenium instance with TestNG
    • Time for action – creating a test from scratch
    • Selenium Remote Control best practises
    • Time for action – setting up the test
    • Time for action – moving Selenium steps into Private methods to make tests maintainable
    • Time for action – using the Page Object Pattern to design tests
    • Setting our tests up in a Continuous Integration server
    • Time for action – creating an Ant file
    • Summary
  • Chapter 8: Advanced Selenium Techniques
    • Important preliminary points
      • Cookie handling
    • Time for action – getting a cookie off the page
      • Getting all cookies
    • Time for action – getting all cookies on the page
      • Deleting cookies
    • Time for action – deleting a cookie
    • Adding a new location strategy
    • Time for action – adding a new location strategy
    • Capturing network traffic
    • Time for action – capturing network traffic
    • Capturing screenshots
      • captureScreenshot call
    • Time for action – capturing screenshots
    • Time for action – capturing a screenshot to string
      • Capturing the entire page
    • Time for action – capturing the entire page as a screenshot
    • Time for action – capture entire page as a screenshot changing background colour
    • Time for action – capturing the entire page screenshot to a string
    • Capturing video
    • Time for action – setting up the environment to capture video
    • Time for action – recording a video in a test
    • Summary
  • Chapter 9: Getting Started with Selenium Grid
    • Important preliminary points
    • Understanding Selenium Grid
    • Checking that we have the necessary items for Selenium Grid
    • Time for action – doing a sanity check on Selenium Grid
    • Selenium Grid Hub
    • Time for action – launching the hub
    • Adding instances to the hub
    • Time for action – adding a remote control with the defaults
      • Adding Selenium Remote Controls for different machines
    • Time for action – adding Selenium Remote Controls for different machines
      • Adding Selenium Remote Control for different browsers
    • Time for action – setting the Environment when starting Selenium Remote Control
      • Updating the Selenium Grid Configuration
    • Time for action – adding new items to the Grid Configuration
    • Running tests against the Grid
    • Time for action – writing tests against the grid
    • Summary
  • Chapter 10: Running Selenium Tests in Parallel
    • Important preliminary points
    • Setting up TestNG
    • Time for action – starting to create the test suite
      • Parameters in the configuration file
    • Time for action – creating a test node in the TestNG configuration
      • Getting our tests to use parameters
    • Time for action – adding the parameters to our tests
      • Parallel testing
    • Time for action – getting our tests running in parallel
    • Tips and tricks for running tests in parallel
      • Independent tests
      • Cleaning up tests
      • Username and password
      • Firefox profiles
    • Summary
  • Chapter 11: Getting Started with Selenium 2
    • Important preliminary points
    • Why Selenium and WebDriver are being merged
      • So what if a new browser is released?
    • How will the browser interaction change?
    • Converting Selenium 1 tests to Selenium 2
    • Time for action – converting tests to Selenium 2 using WebDriverBackedSelenium
    • Starting a Selenium 2 browser instance
    • Time for action – instantiating new browsers and closing them
    • Accessing elements on the page and interacting with them
    • Time for action – finding a link and clicking it
      • Finding elements with XPath
    • Time for action – finding an element with XPath
      • Finding multiple elements
    • Time for action – finding multiple elements on the page
      • Typing into input fields
    • Time for action – typing into a text box
      • Real-life interaction
    • Time for action – working with hidden elements throws errors
    • Working with JavaScript in Selenium 2
    • Time for action – using JavaScript in Selenium 2
      • Returning something from your JavaScript to your test
    • Time for action – returning from executing JavaScript
    • Summary
  • Pop Quiz Answers
    • Chapter 1 – Getting Started with Selenium IDE
    • Chapter 2 – Locators
    • Chapter 3 – Pattern Matching
    • Chapter 4 – Using JavaScript
    • Chapter 5 – User Extensions and Add-ons
    • Chapter 6 – First Steps with Selenium RC
    • Chapter 7 – Creating Selenium Remote Control Tests
    • Chapter 8 – Advanced Selenium Techniques
    • Chapter 9 – Getting Started with Selenium Grid
    • Chapter 10 – Running Selenium Tests in Parallel
    • Chapter 11 – Getting started with Selenium 2

David Burns

David Burns is a Senior Developer in Test having worked with Selenium for quite a few years. He is a Selenium Core Committer and so he knows and understands what users and developers want from the framework.

Sorry, we don't have any reviews for this title yet.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 5 submitted: last submission 26 Mar 2013

Errata type: Others | Page number: 20

Step 3 reads: Once the window has loaded, click on the Close the window text inside it
It should be:
Once the window has loaded, click on the Text within the pop up window text inside it

 

Errata type: Others | Page number: 117

On step 9 at the bottom of the page, it says to export as Java from the Selenium IDE. However, there is no Java option.
It appears as though that functionality has been changed to no longer be in the IDE but an add-on for the new IDE.

 

Errata type: Others | Page number: 109

Under the heading Time for action – running our tests in Internet Explorer
The first line should read:
Now that we are aware that we need to make sure that our web applications work in Internet Explorer, let us have a look at how we can make our Selenium IDE tests work on the same

 

Errata type: Others | Page number: 53

Should be 'Enter css=div#divontheleft *:nth-child(3).' to select the same element as the xpath

 

Errata type: Code | Page number: 93

Under the heading Time for action – using browserbot from within an extension
In step-2:
The statement: this.browserbot.getUserWindow().checkDate(prettyDay); is a valid statement under the context of page: http://www.theautomatedtester.co.uk/tutorials/selenium/Selenium_JavaScript.html rather than the page: http://book.theautomatedtester.co.uk/

 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Selenium 1.0 Testing Tools: Beginner’s Guide +    Railo 3 Beginner’s Guide =
50% Off
the second eBook
Price for both: ₨314.00

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Use Selenium IDE to record, edit, and debug tests
  • Create tests to access JavaScript
  • Set Up the all important Selenium Remote Control successfully
  • Develop automated tests using the Selenium Remote Control
  • Get to grips with Selenium Remote Control Best practises
  • Set up the Selenium Grid to extend your Selenium RC
  • Create tests for Selenium Grid that can be distributed across multiple servers, saving you time by running tests in parallel
  • Create tests for Selenium 2
  • Create locators for elements on the web page
  • A wide range of miscellaneous tips, tricks and tasks to help get your web applications one step closer to perfection

In Detail

Selenium is a suite of tools to automate web application testing across many platforms. A strong understanding of using Selenium will get you developing tests to ensure the quality of your applications.

This book helps you understand and use Selenium to create tests and make sure that what your user expects to do can be done. It will guide you to successfully implement Selenium tests to ensure the quality of your applications.

The Selenium Testing Tools Beginner’s guide shows developers and testers how to create automated tests using a browser. You’ll be able to create tests using Selenium IDE, Selenium Remote Control and Selenium 2 as well. A chapter is completely dedicated to Selenium 2. We will then see how our tests use element locators such as css, xpath, DOM to find elements on the page.
Once all the tests have been created we will have a look at how we can speed up the execution of our tests using Selenium Grid.

A beginner’s guide to writing Selenium tests using different aspects of the Framework to give you confidence in your web application

Approach

Written with a fast-paced but friendly and engaging approach, this Packt Beginner's Guide is designed to be placed alongside the computer as your guide and mentor. Step-by-step tutorials are bolstered by explanations of the reasoning behind what you are doing. You will quickly pick up the necessary skills, tips, and tricks for creating successful tests for your web applications with practical examples that help you to learn by experiment and play.

Who this book is for

If you are a Software quality assurance professional, software project manager, or software developer interested in developing automated testing in web based applications, then this book is definitely for you.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software