售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Selenium Testing Tools Cookbook Second Edition
Table of Contents
Selenium Testing Tools Cookbook Second Edition
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
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started
Introduction
Configuring the Selenium WebDriver test development environment for Java with Eclipse and Maven
Getting ready
How to do it...
How it works...
There's more…
Using Ant for the Selenium WebDriver test execution
Getting ready
How to do it...
How it works...
Configuring Microsoft Visual Studio for Selenium WebDriver test development
Getting ready
How to do it...
How it works...
Configuring Selenium WebDriver for Python and Ruby
Getting ready
Installing Python
Installing Ruby
How to do it...
Installing Selenium WebDriver with Python
Installing Selenium WebDriver with Ruby
How it works...
Setting up Internet Explorer Driver Server
Getting ready
How to do it...
How it works...
There's more…
Setting up ChromeDriver for Google Chrome
Getting ready
How to do it...
How it works...
Setting up Microsoft WebDriver for Microsoft Edge
Getting ready
How to do it...
How it works...
2. Finding Elements
Introduction
Using browser tools for inspecting elements and page structure
How to do it...
Inspecting pages and elements with Mozilla Firefox using the Firebug add-on
Inspecting pages and elements with Google Chrome
Inspecting pages and elements with Microsoft Internet Explorer
How it works...
Finding an element using the findElement method
How to do it...
Finding elements by the ID attribute
Finding elements by the Class attribute
How it works...
There's more...
NoSuchElementFoundException
See also
Finding elements using the findElements method
How to do it...
How it works...
See also
Finding links
How to do it...
Finding a link by its text
Finding a link by partial text
How it works...
There's more...
See also
Finding elements by tag name
How to do it...
How it works...
See also
Finding elements using XPath
Selecting nodes
How to do it...
Finding elements with an absolute path
Finding elements with a relative path
Finding elements using predicates
Finding elements using attributes values with XPath
Finding elements using attributes with XPath
Matching any attribute using a value
Selecting unknown nodes
Selecting several paths
Locating elements with XPath axes
How it works...
Finding elements using CSS selectors
How to do it...
Finding elements with an absolute path
Finding elements with a relative path
Finding elements using the Class selector
Finding elements using the ID selector
Finding elements using the attributes selector
Finding elements using the attributes name selector
Selecting several paths
Performing a partial match on attribute values
How it works...
See also
Locating elements using text
How to do it...
Using XPath's text function
Finding elements using exact text value in XPath
Using the CSS selector contains() pseudo-class
How it works...
Finding elements using advanced CSS selectors
How to do it...
Finding child elements
Finding sibling elements
Using user action pseudo-classes
Using UI state pseudo-classes
How it works...
See also
Using jQuery selectors
How to do it...
How it works...
There's more...
3. Working with Elements
Introduction
Automating textboxes, text areas, and buttons
How to do it...
Clearing text from textbox and text-area elements
Entering text in textbox and text-area elements
Submitting forms
Performing a click on a button element
How it works...
See also
Checking an element's text
How to do it...
How it works...
There's more...
See also
Checking an element's attribute and CSS values
How to do it...
How it works...
Automating dropdowns and lists
How to do it...
How it works...
Selection/deselection by visible text
Selection/deselection by value
Selection/deselection by index
There's more...
See also
Checking options in the Select element
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...
Checking selected options in a multi-select dropdown or list
There's more...
See also
Automating radio buttons and radio groups
How to do it...
How it works...
Working with radio groups
Automating checkboxes
How to do it...
How it works...
Working with WebTables
How to do it...
How it works...
There's more…
4. Working with Selenium API
Introduction
Checking an element's presence
How to do it...
How it works...
See also
Checking an element's state
How to do it...
How it works...
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
Working with context menus
How to do it...
How it works...
There's more...
See also
Executing the 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...
Capturing screenshots with RemoteWebDriver/Selenium Grid
See also
Maximizing the browser window
Getting ready
How to do it...
Handling session cookies
Getting ready
How to do it...
How it works...
Working with browser navigation
Getting ready
How to do it...
How it works...
Working with WebDriver events
Getting ready
How to do it...
There's more...
5. Synchronizing Tests
Introduction
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 an element's attribute value update
Waiting for an element's visibility
Waiting for DOM events
See also
Synchronizing a test with FluentWait
How to do it...
How it works...
There's more...
See also
6. Working with Alerts, Frames, and Windows
Introduction
Handling a simple JavaScript alert box
How to do it...
How it works...
There's more...
The NoAlertPresentException
See also
Handling a confirm and prompt alert box
The prompt alert box
How to do it...
Handling a prompt box
How it works...
See also
Identifying and handling frames
How to do it...
How it works...
There's more…
See also
Working with IFRAME
How to do it...
How it works...
See also
Identifying and handling a child window
How to do it...
How it works...
There's more...
See also
Identifying and handling a 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
7. 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 works...
See also
Creating a data-driven test in NUnit
Getting ready
How to do it...
How it works...
See also
Creating a data-driven test in MSTEST
Getting ready
How to do it...
How it works...
See also
Creating a data-driven test in Ruby using Roo
Getting ready
How to do it...
How it works...
There's more...
Creating a data-driven test in Python using DDT
Getting ready
How to do it...
How it works...
8. Using the Page Object Model
Introduction
Using the PageFactory class for exposing the elements on a page
Getting ready
How to do it...
How it works...
The FindBy annotations
The CacheLookUp attribute
Using the PageFactory class for exposing an operation on a page
Getting ready
How to do it...
How it works...
Using the LoadableComponent class
Getting ready
How to do it...
How it works...
Implementing nested Page Object instances
Getting ready
How to do it...
How it works...
See also
Implementing the Page Object model in .NET
Getting ready
How to do it...
How it works...
Implementing the Page Object model in Python
Getting ready
How to do it...
How it works...
Implementing the Page Object model in Ruby using the page-object gem
Getting ready
How to do it...
How it works...
9. Extending Selenium
Introduction
Creating an extension class for web tables
Getting ready
How to do it...
How it works...
Creating an extension for the jQueryUI tab widget
Getting ready
How to do it...
How it works...
There's more...
Implementing an extension for the WebElement object to set the element attribute values
Getting ready
How to do it...
How it works...
See also
Implementing an extension for the WebElement object to highlight elements
Getting ready
How to do it...
How it works...
See also
Creating an object map for Selenium tests
Getting ready
How to do it...
How it works...
There's more…
Capturing screenshots of elements in the Selenium WebDriver
How to do it...
How it works...
See also
Comparing images in Selenium
Getting ready
How to do it...
How it works...
There's more...
See also
Measuring performance with the Navigation Timing API
Getting ready
How to do it...
How it works...
10. Testing HTML5 Web Applications
Introduction
Automating the HTML5 video player
How to do it...
How it works...
The video playback
See also
Automating interaction on the HTML5 canvas element
How to do it...
How it works...
See also
Web storage – testing local storage
How to do it...
How it works...
There's more...
See also
Web storage – testing session storage
How to do it...
How it works...
See also
Cleaning local and session storage
How to do it...
See also
11. Behavior-Driven Development
Introduction
Using Cucumber-JVM and Selenium WebDriver in Java for BDD
Getting ready
How to do it...
How it works...
There's more…
See also
Using SpecFlow.NET and Selenium WebDriver in .NET for BDD
Getting ready
How to do it...
Creating a spec file
Creating a step definition file
Defining a Page object and a helper class
Running the tests
How it works...
See also
Using Capybara, Cucumber, and Selenium WebDriver in Ruby
Getting ready
How to do it...
How it works...
See also
Using Behave and Selenium WebDriver in Python
Getting ready
How to do it...
How it works...
See also
12. Integration with Other Tools
Introduction
Configuring Jenkins for continuous integration
Getting ready
How to do it...
Adding JDK
Adding Ant
Adding Maven
There's more…
See also
Using Jenkins and Maven for Selenium WebDriver test execution in continuous integration
Getting ready
How to do it...
Scheduling build for an automatic execution
How it works...
Scheduling builds
Test results
See also
Using Ant for Selenium WebDriver test execution
Getting ready
How to do it...
How it works...
See also
Using Jenkins and Ant for Selenium WebDriver test execution in continuous integration
Getting ready
How to do it...
Scheduling the build for an automatic execution
See also
Automating a non-web UI in Selenium WebDriver with AutoIt
Getting ready
How to do it...
Creating the AutoIt script
Using OpenDialogHandler in Selenium WebDriver script
How it works...
There's more…
See also
Automating a non-web UI in Selenium WebDriver with Sikuli
Getting ready
How to do it...
How it works...
There's more…
See also
13. Cross-Browser Testing
Introduction
Testing the framework for parallel execution
Setting up Selenium Grid Server for parallel execution
Getting ready
How to do it...
How it works...
There's more...
Adding nodes to Selenium Grid for cross-browser testing
How to do it...
Adding an IE node
Adding a Firefox node
Adding a Chrome node
Mac OS X with Safari
Creating and executing the Selenium script in parallel with TestNG
Getting ready
How to do it...
How it works...
Creating and executing the Selenium script in parallel with Python
How to do it...
How it works...
There's more...
See also
Using Cloud tools for cross-browser testing running tests in the Cloud
Getting ready
How to do it...
Running tests in headless mode with PhantomJS
Getting ready
How to do it...
How it works...
There's more...
14. Testing Applications on Mobile Browsers
Introduction
Setting up Appium for testing mobile applications
How to do it...
Testing mobile web applications on iOS using Appium
Getting ready
How to do it...
How it works...
Testing mobile web applications on Android using Appium
Getting Ready
How to do it...
How it works...
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜