In our last article we did an introduction to Parallel Testing. In this opportunity we will talk about how to run parallel test cases using the Selenium software.
What is Selenium?
Selenium is an open-source project which develops a variety of tools and libraries oriented at web browser automation support. Within the Selenium range we have tools and frameworks like Selenium IDE –for recording and editing functional test executions, Selenium WebDriver –used to write scripts for automating browser actions, and Selenium Grid.
Selenium Grid is the Selenium component –essentially a server application– which lets us run parallel executions, by instantiating multiple browsers (WebDriver nodes) on remote machines –whether virtual or real, which receive commands from a central server (hub) which are triggered by the client’s test scripts. This is what makes Grid a useful tool for automating tests in parallel, by being able to instantiate different browsers, and within those, different versions and configurations, hence, Grid notably saves execution time and provides high flexibility for creating test scenarios.
Writing Test Scripts
While Grid solves the distribution aspect of parallel testing for us, we’re still left with the need for a tool to actually automate our test cases. One of the most used tools for that purpose nowadays is TestNG. TestNG is a unit testing framework for the Java language, which can also perform functional, E2E and integration tests. Like most xUnit frameworks, it supports Data Driven –or parameterized– testing, annotations, as well as multiple class instances, among other features.
To implement parallel execution, TestNG provides an XML file, where we can give a parallel attribute a determined set of values –’methods’, ‘tests’, ‘classes’ or ‘instances’– allowing also to set the number of threads needed to create for parallel execution.
What the parallel attribute values mean:
- Methods: run methods in separate threads.
- Tests: run all methods from the same tag in the same thread.
- Classes: run all methods from a class in a single thread.
- Instances: run all methods in the same instance, in the same thread.
To Write or Not to Write (what is the question?)
The current demands of today’s market and technological state of the art inevitably gives birth to a new breed of tools which perform faster, better and easier. A short learning curve doesn’t have to imply a shortcoming in functionality anymore.
Autify software runs on AI algorithms, learning the user’s actions and creating test scenarios and test cases, virtually on the fly, thanks to its no code platform. What does that mean? No more writing test scripts.
The AI technology also takes charge of maintaining test cases, since it adapts autonomously to changes –because it learns the UI states, while alerting the test team every time a change takes place.
Faster bug detection means faster delivery time with lower error margin. That’s where Autify’s built-in reporting tool enters the game.
Having great cross browser compatibility and ability to run 10~ parallel test executions, Autify supports both parallel executions via a lightweight Docker container and cross-browser compatibility test on a real machine.
Autify is an invaluable deal when it comes to saving costs. Also, as a SaaS delivered software, it’s guaranteed to be always updated and secured.
Bundled with all these features is a kind of tech support which every good customer deserves.
We invite you to check some of our client’s success stories here: https://autify.com/why-autify
- Autify is positioned to become the leader in Automation Testing Tools.
- We got 10M in Series A in Oct 2021, and are growing super fast.
Transparent pricing is key to our business philosophy.
At Autify we have different pricing options available in our plans: https://autify.com/pricing
- Small (Free Trial). Offers 400~ test runs per month, 30 days of monthly test runs on 1 workspace.
- Advance. Offers 1000~ test runs per month, 90~ days of monthly test runs on 1~ workspace.
- Enterprise. Offers Custom test runs per month, custom days of monthly test runs and 2~ workspaces.
All plans invariably offer unlimited testing of apps and number of users.