Book Image

Selenium Design Patterns and Best Practices

By : Dima Kovalenko
Book Image

Selenium Design Patterns and Best Practices

By: Dima Kovalenko

Overview of this book

Table of Contents (18 chapters)
Selenium Design Patterns and Best Practices
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Testing a mobile site


Like many other websites, ours has a special stripped down version to be used with smart phones. The ability to leave comments on any product remains, but the steps to fill up the product comment are now different. So in this section, we will make product_review.feature work on both regular and mobile websites. Let's update our test suite to run on both the full browser version and mobile browser version.

Note

Typically, testing mobile versions of a website can be better accomplished by driving the tests on the actual smart phone or in an emulator. There are two good projects that allow WebDriver tests to run on mobile devices. These projects are iOS Driver and Appium. The project websites are listed respectively: http://ios-driver.github.io/ios-driver and http://appium.io. However, modifying the browser's user agent does not require as much setup time.

Updating the Selenium wrapper

Our first step is to modify how Firefox identifies itself to websites by modifying the user...