万本电子书0元读

万本电子书0元读

顶部广告

Mastering Selenium WebDriver 3.0电子书

售       价:¥

4人正在读 | 0人评论 9.8

作       者:Mark Collin

出  版  社:Packt Publishing

出版时间:2018-06-29

字       数:47.6万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Complement Selenium with useful additions that fit seamlessly into the rich and well-crafted API that Selenium offers About This Book ? Understand the power, simplicity, and limitations of the core Selenium framework ? Write clear, readable, and reliable tests that perform complex test automation tasks ? Work with ChromeDriver and GeckoDriver in headless mode Who This Book Is For If you are a software tester or a developer with working experience in Selenium and competency with Java, who is interested in automation and are looking forward to taking the next step in their learning journey, then this is the book for you. What You Will Learn ? Provide fast, useful feedback with screenshots ? Create extensible, well-composed page objects ? Utilize ChromeDriver and GeckoDriver in headless mode ? Leverage the full power of Advanced User Interactions APIs ? Use JavascriptExecutor to execute JavaScript snippets in the browser through Selenium ? Build user interaction into your test script using JavascriptExecutor ? Learn the basics of working with Appium In Detail The second edition of Mastering Selenium 3.0 WebDriver starts by showing you how to build your own Selenium framework with Maven. You'll then look at how you can solve the difficult problems that you will undoubtedly come across as you start using Selenium in an enterprise environment and learn how to produce the right feedback when failing. Next, you’ll explore common exceptions that you will come across as you use Selenium, the root causes of these exceptions, and how to fix them. Along the way, you’ll use Advanced User Interactions APIs, running any JavaScript you need through Selenium; and learn how to quickly spin up a Selenium Grid using Docker containers. In the concluding chapters, you‘ll work through a series of scenarios that demonstrate how to extend Selenium to work with external libraries and applications so that you can be sure you are using the right tool for the job. Style and approach This book is a pragmatic guide that takes you through the process of creating a test framework with Selenium 3. It then shows you how you can extend this framework to overcome common obstacles that you will come across whilst using Selenium.
目录展开

Title Page

Copyright and Credits

Mastering Selenium WebDriver 3.0 Second Edition

Contributors

About the author

About the reviewers

Packt is searching for authors like you

Packt Upsell

Why subscribe?

PacktPub.com

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Conventions used

Get in touch

Reviews

Creating a Fast Feedback Loop

Making it easy for developers to run tests

Building our test project with Apache Maven

Running your tests in parallel

Parallel tests with TestNG

There are no silver bullets

Multiple browser support

Downloading WebDriver binaries automatically

Going headless

What happened to GhostDriver?

Summary

Producing the Right Feedback When Failing

Location, location, location

Tests are living documentation

Reliability

The test automation team that works in isolation

Oh, that test always flickers – don't worry about it

Baking in reliability

Git

Subversion

Continuous integration is key

Setting up TeamCity

Setting up Jenkins

Extending our capabilities by using a Selenium-Grid

A picture paints a thousand words

Don't be afraid of the big bad stack trace

Summary

Exceptions Are Actually Oracles

NoSuchElementException

NoSuchFrameException

NoSuchWindowException

ElementNotVisibleException

StaleElementReferenceException

InvalidElementStateException

UnsupportedCommandException

UnreachableBrowserException

SessionNotFoundException

WebDriverException – element is not clickable at point

NoAlertPresentException

Summary

The Waiting Game

Are we nearly ready yet?

I've timed it, and I know it takes 5 seconds for the page to load

Machine specification

Server specification

JavaScript engine performance

Networks

So, what do we do?

I just want Selenium to do it for me

Page load timeout

Script timeout

Implicitly wait timeout

It can slow my tests down?

It can break explicit waits?

The explicit wait that never finds an element

Hang on, I've tried this and it didn't work that way for me!

The explicit wait that works, but slows your tests down

The solution

Using explicit waits

Fluent waits, the core of explicit waits

Functions

Java8 lambdas

Summary

Working with Effective Page Objects

Why do you keep repeating yourself?

Starting out with page objects

Separation of concerns with page objects

Introducing the Java PageFactory class

Using PageFactory annotations

Initializing proxied objects

Problems with the Java PageFactory class

Introducing the Query object

So, which option should I use?

Creating extensible page objects

Turning your page objects into a readable DSL

Fluent page objects

Summary

Utilizing the Advanced User Interactions API

Getting started with the API

Using the API to solve difficult problems

Working with hover menus

Working with drag and drop

Working with offsets

Working with access keys

The Advanced Interactions API doesn't always work for me

Summary

JavaScript Execution with Selenium

Introducing the JavaScript executor

Let's not get carried away

So, what should we do with it?

A more complex example

Executing complex blocks of JavaScript with the JavascriptExecutor

Can I use JavaScript libraries?

Should I inject JavaScript libraries?

What about asynchronous scripts?

Building user interaction into your automation

Summary

Keeping It Real

File downloads with Selenium

The scenario

The problem

So, what's next?

Do you really need to download that file?

Checking that links are valid

What if I do need to download the file?

AutoIt

Java Robot class

Browser auto download

Extending our existing code

Downloading a file with the help of Selenium

But that's not the same as clicking on a link and downloading the file

Checking that the file we have downloaded is the correct one

You cannot track network traffic with Selenium

But I really want to track my network traffic!

Writing performance tests with Selenium

Penetration testing with Selenium

Summary

Hooking Docker into Selenium

Introducing Docker

Spinning up Selenium-Grid with Docker

Running tests against our new Selenium-Grid

Starting up Docker containers as part of the build

Using a Docker Maven plugin

Using Docker compose

What about the negatives?

Summary

Selenium – the Future

Machine learning — the new Holy Grail

Visual validation

Applitools Eyes

So what has this got to do with AI?

Self healing tests

Having your tests written for you

Summary

Appendix A: Contributing to Selenium

Selenium is amazing – how can I help make it better?

Getting set up to contribute to a Selenium repository

Aiding the documentation effort

Making changes to Selenium

Keeping your history clean

Now it's your turn

Appendix B: Working with JUnit

Switching from TestNG to JUnit

Summary

Appendix C: Introduction to Appium

Creating an Appium framework

Automating the Android calculator

Running the tests through Maven

Starting and stopping Appium with Maven

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部