PacktLib: Selenium 2 Testing Tools: Beginner’s Guide

Selenium 2 Testing Tools Beginner's Guide

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started with Selenium IDE

Important preliminary points

What is Selenium IDE

Time for action – installing Selenium IDE

Selenium IDE

Important note: Rules for automation

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

Multiplying windows

Time for action – working with multiple windows

Time for action – complex working with 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

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 via JavaScript

Time for action - finding elements by XPath

Time for action – finding elements by direct XPath

Using XPath Axis to find elements

Time For Action – using XPath Axis

CSS selectors

Time for action - finding elements by CSS

Time for action – finding the nth element with CSS

Summary

Overview of Selenium WebDriver

Important preliminary points

History of Selenium

Architecture

How to set up your Java environment

Time for action – setting up Intellij IDEA project

Summary

Design Patterns

Important preliminary points

Page Objects

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

Using Page Factories with Page Objects

Time for action – using PageFactory

LoadableComponent

Time for action – changing our Page Object to use LoadableComponent

Summary

Finding Elements

Important preliminary points

Finding elements

Time for action – using findElementById()

Time for action – using findElementsById()

Time for action – using findElementByName()

Time for action – using findElementsByName()

Time for action – using findElementByClassName()

Time for action – using findElementsByClassName()

Time for action – using findElementByXPath()

Time for action – using findElementsByXpath()

Time for action – using findElementByLinkText()

Time for action – using findElementsByLinkText()

Finding elements using a more generic method

Time for action – using findElement()

Time for action – using findElements()

Tips and tricks

Time for action – using implicit waits

Time for action – using explicit waits with Selenium WebDriver

Summary

Working with WebDriver

Important preliminary points

Working with FirefoxDriver

Time for action – loading the FirefoxDriver

Time for action – setting Firefox preferences

Time for action – installing the add-on

Working with ChromeDriver

Time for action – starting Google Chrome or Chromium

Time for action – using ChromeOptions

Working with OperaDriver

Time for action – starting Opera

Time for action – working with OperaProfile

Working with InternetExplorerDriver

Time for action – working with Internet Explorer

Other important points

Summary

Mobile Devices

Important preliminary points

Working with Android

Time for action – creating an emulator

Time for action – installing the Android Server

Time for action – using the Android driver

Running with OperaDriver on a mobile device

Time for action – using OperaDriver on Opera Mobile

Working with iOS

Time for action – setting up the simulator

Time for action – setting up on a real device

Time for action – using the iPhone driver

Summary

Getting Started with Selenium Grid

Understanding Selenium Grid

Selenium Grid Hub

Time for action – launching the hub

Adding instances to the hub

Time for action – adding a server with the defaults

Adding Selenium Remote Controls for different machines

Time for action – adding Selenium server for different machines

Adding Selenium server to do specific browser tasks on specific operating systems

Time for action – setting the environment when starting Selenium Remote Control

Using Selenium Grid 2 with your YAML file

Time for action – using Selenium Grid 1 configuration

Running tests against the grid

Time for action – writing tests against the grid

Running tests in parallel

Time for action – getting our tests running in parallel

Summary

Advanced User Interactions

Important preliminary points

What is the Advanced User Interactions

Actions

Time for action – creating an Actions chain for dragging and dropping

Time for action – moving an element with a drag-and-drop by offset

Time for action – doing a context click

Time for action – selecting multiple items on a select item

Time for action – holding the mouse button down while moving the mouse

Summary

Working with HTML5

Important preliminary points

Working with application cache

Time for action – getting the current status of application cache

Interacting with browser connections

Time for action – seeing if the browser is online

Time for action – setting the browser connection to offline or online

Working with WebStorage

Time for action – accessing localStorage

Time for action – accessing sessionStorage

Summary

Advanced Topics

Important preliminary points

Capturing screenshots

Time for action – capturing images as base64 strings

Time for action – saving images to bytes

Time for action – saving a screenshot to file

Using XVFB with Selenium

Time for action – setting up XVFB server

Time for action – running tests with XVFB

Working with BrowserMob Proxy

Time for action – starting the proxy

Time for action – capturing network traffic

Summary

Migrating from Remote Control to WebDriver

Migrating from Remote Control to WebDriver

Migrating from Remote Control to WebDriver

Migrating from Remote Control to WebDriver

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Index