万本电子书0元读

万本电子书0元读

顶部广告

Selenium Testing Tools Cookbook - Second Edition电子书

售       价:¥

7人正在读 | 0人评论 6.2

作       者:Unmesh Gundecha

出  版  社:Packt Publishing

出版时间:2015-10-30

字       数:218.6万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Over 90 recipes to help you build and run automated tests for your web applications with Selenium WebDriverAbout This BookLearn to leverage the power of Selenium WebDriver with simple examples that illustrate real-world problems and their workaroundsExplains the testing of mobile applications with Appium for mobile platforms such as iOS and AndroidA pragmatic manual with engaging recipes and attractive screenshots to test your web applications efficiently Who This Book Is For This book is intended for software quality assurance/testing professionals, software project managers, or software developers with prior experience in using Selenium and Java to test web-based applications. This books also provides examples for C#, Python and Ruby users.What You Will LearnUnderstand how the locators work and use various locator methods to build reliable testsBuild reliable and maintainable tests with the Selenium WebDriver APIUse the PageFactory pattern to build a robust and easy to maintain test frameworkBuild data-driven tests and extend Selenium API to implement custom steps and checksIntegrate and use ATDD/BDD tools such as Cucumber, SpecFlow, Capybara, and Behave with the Selenium WebDriver APISet up iPhone/iPad and Android simulators and devices to test your mobile web application with AppiumSet up Selenium Grid for faster and parallel running of tests, increasing test coverage and reducing test execution time for cross-browser testingBuild extended Selenium WebDriver tests for additional coverage In Detail This book is an incremental guide that will help you learn and use the advanced features of the Selenium toolset including the WebDriver API in various situations to build a reliable test automation. You start off by setting up the test development environment and gain tips on the advanced locater strategy and the effective use of the Selenium WebDriver API. After that, the use of design patterns such as data - driven tests and PageFactory are demonstrated. You will then be familiarised with extending Selenium WebDriver API by implementing custom tasks and setting up your own distributed environment to run tests in parallel for cross-browser testing. Finally, we give you some tips on integrating Selenium WebDriver with other popular tools and testing mobile applications. By the end of this book, you will have learned enough to solve complex testing issues on your own.Style and approach This recipe-based guide covers real-life scenarios of testing your web apps with Selenium. Each recipe begins with a short introduction and key concepts along with illustrated examples of use cases, and ends with detailed but informative de*ions of the inner workings of the example.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部