Book Image

Learning Selenium Testing Tools - Third Edition

Book Image

Learning Selenium Testing Tools - Third Edition

Overview of this book

Table of Contents (22 chapters)
Learning Selenium Testing Tools Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Interacting with browser connections


Now that we can download and cache files using the application cache, it will be a good idea to see how well they work when there is no network connection. The mobile drivers have the ability to go into airplane mode. Hopefully, future versions of desktop browsers will have this ability too.

We will start by having a look at whether the browser is online.

Seeing if the browser is online

Seeing if a browser is online during a test can be quite useful when we are testing how our application works offline. This is useful for working against sites that have the application cache configured so you can check whether the site works when offline. We first need to make sure we know how to check if the browser is online.

Let's see how this looks.

Checking the browser status

In this section, we will have a look at whether the browser is online or offline. Currently, this only works on mobile drivers from Selenium WebDriver. In this section, we will need to cast the Selenium...