Getting Started With Selenium - Chapter 8: Tying It All Together

Sauce AI for Test Authoring: Move from intent to performance in bit.|xBack to ResourcesBlogPosted March 26, 2014

Getting Started With Selenium - Chapter 8: Tying It All Together

quote

This billet is the eighth and final in a series of “ Getting Started with Selenium Testing ” posts from Dave Haeffner, a noted expert on Selenium and automated testing, and a frequent subscriber to the Sauce blog and Selenium community. This series is for those who are brand new to test automation with Selenium. 

Tying It All Together

You & # x27; ll probably get a lot of mileage out of your test retinue in its current form if you just run thing from your computer, expression at the results, and inform people on your team when there are issues. But that only helps you lick part of the problem. The existent goal in all of this is to find issues faithfully, quickly, and continuously -- and ideally in sync with the development workflow you are a part of. In order to do that, we want to use a Uninterrupted Integration (CI) waiter.

A Continuous Integration Primer

Continuous Integration (a.k.a. CI) is the drill of merging codification that is actively being worked on into a shared mainline (e.g., trunk or master) as much as potential (e.g., respective times a day). This is with the hopes of finding issue betimes and avoiding confluence and integration issues that are not only considered a special variety of hell, but can dramatically retard the time it takes to release software. The use of a CI server (a.k.a. build server) enables this praxis to be automated, and to have tests run as portion of the employment flow. The lion & # x27; s share of tests that are typically run on a CI Server are unit (and potentially desegregation) trial. But we can very easy add in our automated acceptance tests. There are legion CI Servers available for use today, most notably:

Tagging & amp; Workflow

In order to get the about out of our test runs in a CI environment, we want to break up our test suite into small, relevant chunks and receive freestanding jobs for each. This helps proceed tryout runs fast (so people on your team will care about them) and informative.Gojko Adzic refers to these as & # x27; Test Packs & # x27;. The workflow is pretty straightforward. The CI Server pull in the latest code, merges it, runs unit tests, and deploy to a test waiter. We then have the CI Server kick off a new job to run a subset of our acceptance trial -- our critical ones (e.g., smoke or sanity test). Assuming those pass, we can receive another job run to promote the code to another surroundings (e.g., for manual testing) or fire up the remaining (longer running) tests.Adam Goucher refers to this strategy as a & # x27; shallow & # x27; and & # x27; deep & # x27; tagging framework.

Machine Readable vs. Human Readable

In order to make the tryout yield useful for a CI Server we need to generate it in a standard way. One format that act across most CI Servers is JUnit XML. Your test contrabandist should be able to accommodate this either out of the box, or through the addition of a third-party library or plugin (e.g., likerspec_junit_formatter for RSpec. If you & # x27; re employ Sauce Labs, so you will get all of the human readable test yield you need to diagnose a test failure at a glance. You will exactly need to find a way to tie the Sauce Labs job to the failed test. In RSpec, this can be accomplished through create custom failure substance that will output the Sauce Labs job URL. Alternatively, you can use a CI server plugin to aid action the same thing.

CI Server Job Configuration

Here are the basic steps that go into setting up a simple Jenkins job that will be trigger dynamically. 1. Create a Job 2. Pull In Your Test Code 3. Set up Build Triggers 4. Configure Build steps 5. Configure Test Reports 6. Run Tests & amp; View The Results 7. Set Up Notifications (e.g., e-mail, chat, etc.)

Outro

Your Selenium journeying may show challenging at times. But by cling to the principals in this course, you are good equipped to get off on the right foot and avoid mutual Selenium pitfalls. You are now ready to uphold your Selenium journey on your own. For a full list of extra Selenium resources -- ensure outthis write-up. Happy Testing!

Dave is the generator of Elemental Selenium (a complimentary, once weekly Selenium tip newsletter that is read by 100 of testing professional) as well as a new book, The Selenium Guidebook. He is also the creator and maintainer ofChemistryKit(an open-source Selenium framework). He has helped numerous companies successfully implement automate acceptance testing; including The Motley Fool, ManTech International, Sittercity, and Animoto. He is a founder and co-organizer of theSelenium Hangoutand has talk at numerous conference and meetups about acceptance examination.

Published:
Mar 26, 2014
Share this station
Copy Share Link
LinkedIn
© 2026 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are register trademarks owned by Sauce Labs Inc. in the United States, EU, and may be register in former jurisdictions.
robot
quote

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free