The Importance of Eliminating Network Hops
Are you experiencing slower execution times while running Selenium scripts in the Selenium cloud network? Too many network hops will add latency and slow down your test execution. Plus, every additional network hop adds cost to your execution. One way to optimize Selenium execution performance is to eliminate as many network hops as possible.
"A hop is one portion of the path between source and destination. Data packets pass through bridges, routers and gateways on the way. Each time packets are passed to the next device, a hop occurs."(1)
The Sauce Labs team is working on a new tool that may be interesting to you. The solution will eliminate a network hop, making running tests in parallel on multiple browsers automatic and simple.
Why Hops Matter
In my first time using a cloud-based solution for Selenium, I was both thrilled and impressed by the possibilities. A cloud-based provider such as Sauce Labs maintains and uses configuration management tools to spin up and tear down virtual machines with various OS platforms and browsers. I understand the value in this type of service. The amount of time and resources needed to build and maintain infrastructure is expensive. Been there, done that!
The downside of testing in the cloud is that you are sending commands outside your network through the cloud and back. It adds another device between source and destination, which adds latency and an additional network hop. The cloud-based approach will slow down test execution when comparing it to local execution from a developer machine.
One of the benefits of being a writer for and client of Sauce Labs is the ability to leverage new tools in beta. One of the newest tools in beta is called Sauce Runner. This new tool is designed to make running tests in parallel on multiple platforms and browsers fast and easy. Sauce Runner facilitates server-side execution of your Selenium scripts, reducing latency, eliminating network hops, and it allows Sauce Labs to automatically handle things like test parallelization and platform selection.
What are the prerequisites to use Sauce Runner?
- GitHub or Bitbucket repository using the supported frameworks
- Add a deployment key to your private repository (only for private repos)
- YAML configuration file, placed in your repository — Your repo is ready to run with Sauce Runner
If your existing repo is using one of the supported frameworks, the configuration will take less than 5 minutes to set up to use the Sauce Runner.
The screenshot below demonstrates a fast and easy way to create a test suite by using Sauce Runner:
Sauce Runner integrates with a few Continuous Integration platforms such as Jenkins, Bamboo, and TeamCity. Once you’ve created your test suite, you’re able to copy the REST Curl command from the test suite details page, then add it to your desired Continuous Integration platform.
Yes, the tool may be geared toward newbies, but I am more excited about the server-side execution since it will reduce latency issues and eliminate network hops. By leveraging the server-side execution of your Selenium script, it will reduce build time by as much as 10%.
Takeaways: Why you should try Sauce Runner
- Server-side execution
- Improve build speed and reliability
- Eliminate network hops and reduce latency for remote execution
- Simplifies the onboarding process for new Sauce Labs clients
- Supports Continuous Integration platforms
- No configuration needed to use parallel testing
- As a beta user, you can help test and submit feature requests
(1)"Hop (networking) - Wikipedia, the free encyclopedia." 2011. 26 Jan. 2016
Greg Sypolt (@gregsypolt) is a senior engineer at Gannett and co-founder of Quality Element. He is a passionate automation engineer seeking to optimize software development quality, while coaching team members on how to write great automation scripts and helping the testing community become better testers. Greg has spent most of his career working on software quality - concentrating on web browsers, APIs, and mobile. For the past five years, he has focused on the creation and deployment of automated test strategies, frameworks, tools and platforms.
- Appium Resources
- Best Practices
- Continuous Delivery
- Continuous Integration
- Continuous Testing
- Cross Browser Testing
- Guest Blog Posts
- Load Testing
- Mobile Development & Testing
- News & Product Updates
- Open Sauce
- Open Source
- Performance Testing
- Product Updates
- Quality Assurance
- Quality Engineering
- Sauce Product Info
- Security Testing
- Selenium Resources
- Software Development & Testing
- The Story of Sauce