Selenium Testing Tools Cookbook
Table of Contents
Selenium Testing Tools Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Locating Elements
Introduction
Using browser tools for inspecting elements and page structure
How to do it...
How it works...
Locating an element using the findElement method
How to do it...
How it works...
There's more...
See also
Locating elements using findElements method
How to do it...
How it works...
See also
Locating links
How to do it...
How it works...
There's more...
See also
Locating elements by tag name
How to do it...
How it works...
See also
Locating elements using CSS selectors
How to do it...
Performing partial match on attribute values
How it works...
See also
Locating elements using XPath
How to do it...
How it works...
Locating elements using text
How to do it...
How it works...
Locating elements using advanced CSS selectors
How to do it...
How it works...
See also
Using jQuery selectors
How to do it...
How it works...
There's more...
Locating table rows and cells
How to do it...
How it works...
There's more…
See also
Locating child elements in a table
How to do it...
How it works...
See also
2. Working with Selenium API
Introduction
Checking an element's text
How to do it...
How it works...
There's more...
Checking an element's attribute values
How to do it...
How it works...
Checking an element's CSS values
How to do it...
How it works...
See also
Using Advanced User Interactions API for mouse and keyboard events
How to do it...
How it works...
See also
Performing double-click on an element
How to do it...
How it works...
See also
Performing drag-and-drop operations
How to do it...
How it works...
See also
Executing JavaScript code
How to do it...
How it works...
There's more...
Capturing screenshots with Selenium WebDriver
How to do it...
How it works...
There's more...
See also
Capturing screenshots with RemoteWebDriver/Grid
Getting ready
How to do it...
How it works...
Maximizing the browser window
Getting ready
How to do it...
How it works...
Automating dropdowns and lists
How to do it...
How it works...
There's more...
See also
Checking options in dropdowns and lists
Getting ready
How to do it...
How it works...
There's more...
See also
Checking selected options in dropdowns and lists
Getting ready
How to do it...
How it works...
There's more...
See also
Automating radio buttons and radio groups
How to do it...
How it works...
Automating checkboxes
How to do it...
How it works...
Controlling Windows processes
How to do it...
How it works...
Reading a Windows registry value from Selenium WebDriver
How to do it...
How it works...
See also
Modifying a Windows registry value from Selenium WebDriver
How to do it...
How it works...
See also
3. Controlling the Test Flow
Introduction
Pop ups and Alerts
Synchronizing a test with an implicit wait
How to do it...
How it works...
See also
Synchronizing a test with an explicit wait
How to do it...
How it works...
See also
Synchronizing a test with custom-expected conditions
How to do it...
How it works...
There's more...
Waiting for element's attribute value update
Waiting for an element's visibility
Waiting for DOM events
Checking an element's presence
How to do it...
How it works...
See also
Checking an element's status
How to do it...
How it works...
Identifying and handling a pop-up window by its name
How to do it...
How it works...
There is more...
NoSuchWindowException
See also
Identifying and handling a pop-up window by its title
How to do it...
How it works...
See also
Identifying and handling a pop-up window by its content
How to do it...
How it works...
See also
Handling a simple JavaScript alert
How to do it...
How it works...
There is more...
NoAlertPresentException
See also
Handling a confirm box alert
How to do it...
How it works...
See also
Handling a prompt box alert
How to do it...
How it works...
See also
Identifying and handling frames
How to do it...
How it works...
See also
Identifying and handling frames by their content
How to do it...
How it works...
See also
Working with IFRAME
How to do it...
How it works...
See also
4. Data-driven Testing
Introduction
Data-driven approach – workflow
Benefits of data-driven testing
Creating a data-driven test using JUnit
Getting ready
How to do it...
How it works...
See also
Creating a data-driven test using TestNG
Getting ready
How to do it...
How it works...
There's more...
See also
Reading test data from a CSV file using JUnit
Getting ready
How to do it...
How it works...
See also
Reading test data from an Excel file using JUnit and Apache POI
Getting ready
How to do it...
How it wo...