Today I’m returning to test automation and looking at a tool that at one time was considered one of the fastest-growing web automation tools due to its speed, ease of use, and effectiveness in interacting web objects – but perhaps was never able to leverage that growth and keep up to date with some of the latest trends. That tool is Sahi and even if its development has fallen a bit on the wayside, it remains quite widely used in certain spaces.
Sahi is an open-source web automation tool primarily used for automating web applications. It provides a simple and powerful scripting interface for automating interactions with web pages. Sahi is particularly useful for automating the testing of web applications, allowing testers to create scripts to simulate user interactions such as clicking buttons, filling forms, validating data, and comparing images.
The biggest strength of the tool is how easy it is to use. Like many other test automation tools, it also features pretty robust record and playback features, but in terms of converting those into automated scripts, Sahi enables users to do this quite easily and it’s easy to convert all identifiable objects into variables and then integrate them into a JavaScript test. If you’re looking to get some UI pages automated quite quickly, it is a great tool to use – though like with every other automation tool, the real strength is in the framework that calls the scripts rather than the tool itself.
Overview of how Sahi works
As a testing tool, it is also quite lightweight and takes up a lot less processing power than other automation tools, making it not only easy for automation with low-end machines but also means it can run in a pipeline on a low-spec VM and still give you sufficient results.
Sahi is open-source, but like many other tools, requires a license to get the best usage out of it. However, one advantage is that its enterprise licenses are far cheaper than many of the other big tools in the automation space and so even if it doesn’t offer as many features as these other tools, for a tool that just does automation – it can be good value for money.
However, it’s those lack of features that is its biggest weakness and while it was a tool with a fast growth trajectory when it first arrived on the scene, its slow adoption of things like headless execution, limited reporting, and a restrictive focus on front-end web automation when many teams are focusing more on backend automation has meant it has become increasingly dated over the year. It continues to be supported by its large community of users and remains perfectly effective in its purpose. However, with even some open-source tools like Selenium, Cypress, and Playwright offering better features for full-stack engineering, it’s a tough sell for new companies looking to develop their UI Automation capabilities.
Here are some key features and aspects of Sahi
Scripting Language: Sahi scripts are written in JavaScript and can be easily understood by testers and developers alike. This scripting language allows for the creation of robust and reusable automation scripts.
Browser Compatibility: Sahi supports automation across various web browsers including Chrome, Firefox, Internet Explorer, Safari, and Opera. This cross-browser compatibility is essential for testing web applications across different environments.
Recorder: Sahi provides a powerful recorder tool that captures user interactions with web applications and generates corresponding scripts automatically. This feature accelerates the script creation process and makes it easier for testers to create automation scripts without needing in-depth programming knowledge.
Data-Driven Testing: Sahi supports data-driven testing, allowing testers to parameterize their scripts and execute them with different sets of test data. This is particularly useful for testing scenarios where the same functionality needs to be tested with multiple input values.
Integration with Continuous Integration (CI) Tools: Sahi can be integrated with popular CI tools, allowing for seamless integration of automated tests into the CI/CD pipeline. This integration enables automated tests to be executed automatically as part of the build and deployment process.
Community Support: Sahi has an active community of users and developers who contribute to its development and provide support through forums, documentation, and online resources. This community support is valuable for users seeking assistance, sharing knowledge, and collaborating on improving the tool.
Open Source: Sahi is an open-source tool, meaning it is freely available for anyone to download, use, and modify according to their requirements. This open-source nature fosters innovation, collaboration, and adoption among organizations and individuals.
Here's a brief timeline of Sahi's history:
2005: Narayan Raman began developing Sahi as an in-house tool at ThoughtWorks to automate web application testing tasks. The initial version of Sahi was released as an open-source tool, making it available to the wider testing community.
2006-2008: Sahi gained popularity within the testing community due to its simplicity, ease of use, and robust functionality. It was adopted by various organizations and individuals for automating web application testing processes.
2009-2013: Sahi continued to evolve with regular updates and enhancements to its features and capabilities. The development team focused on improving script recording, playback reliability, browser compatibility, and integration with other testing tools and frameworks.
2014-2018: Sahi maintained its position as a prominent open-source web automation tool during this period. It received contributions from the community, which helped in addressing bugs, adding new features, and enhancing performance.
2019-Present: Sahi has continued to be actively maintained and developed by its community of contributors. Updates and new releases have ensured that Sahi remains relevant and effective for web application testing in the evolving landscape of software development and testing.
Throughout its history, Sahi has been known for its user-friendly interface, support for various browsers, robust scripting capabilities, and active community support. It has been utilized by organizations of all sizes across different industries to automate testing processes and improve the quality of web applications.
While Sahi's development may have slowed down or shifted focus in recent years, its legacy as a reliable and versatile web automation tool persists, and it continues to be used by testers and developers worldwide.
Pros
Easy to Learn: Sahi uses a simple scripting language (JavaScript) and provides a user-friendly interface, making it relatively easy for beginners to learn and start automating web tests.
Cross-Browser Compatibility: Sahi supports automation across multiple web browsers, including Chrome, Firefox, Internet Explorer, Safari, and Opera, ensuring comprehensive test coverage across different browser environments.
Powerful Recorder Tool: Sahi offers a robust recorder tool that enables testers to record their interactions with web applications and automatically generates corresponding scripts, saving time and effort in script creation.
Data-Driven Testing Support: Sahi facilitates data-driven testing by allowing testers to parameterize their scripts and execute them with various sets of test data, enhancing test coverage and efficiency.
Integration with CI Tools: Sahi integrates seamlessly with popular Continuous Integration (CI) tools such as Jenkins, enabling automated tests to be integrated into the CI/CD pipeline for automated execution.
Active Community Support: Sahi has an active community of users and developers who provide support, share knowledge, and contribute to its development, ensuring users have access to assistance and resources when needed.
Open Source: Sahi is an open-source tool, meaning it is freely available for download, usage, and modification, fostering innovation, collaboration, and adoption among organizations and individuals.
Cons
Limited Documentation: While Sahi has documentation available, some users may find it lacking in comprehensiveness or detail, which can pose challenges, especially for beginners trying to grasp advanced concepts or troubleshoot issues.
Dependency on JavaScript: Sahi scripts are written in JavaScript, which may be a limitation for users who are not familiar with JavaScript or prefer other scripting languages. This can potentially restrict the tool's adoption among teams with diverse skill sets.
Complexity in Handling Dynamic Elements: Sahi may encounter challenges in handling dynamic elements or elements with changing attributes on web pages, requiring users to employ advanced scripting techniques or workarounds to address such scenarios.
Limited Built-in Reporting: Sahi provides basic reporting capabilities, but users may find the built-in reporting features lacking in customization options or visual appeal compared to other automation tools. Integrating with external reporting tools may be necessary for more advanced reporting needs.
Maintenance Overhead: Like any automation tool, maintaining Sahi scripts over time may require effort, especially as web applications evolve and change. Users need to regularly update and maintain their scripts to ensure they remain accurate and reliable.
Resource Intensive Recording: While Sahi's recorder tool is powerful, recording large or complex interactions with web applications may consume significant system resources, leading to performance issues on some machines.
Limited Community Size: While Sahi has an active community, it may not be as extensive as communities around some other automation tools, which could impact the availability of support and resources in certain cases.
When to consider choosing Sahi
You have a skilled JavaScript team that is looking for a simple tool that can produce automated scripts quickly and easily.
Your automation needs are predominantly focused on front-end web coverage with little need for backend automation
You need a lightweight UI tool that can easily be integrated into your CI/CD pipelines.
Overall, as ease of use gets, few automation tools will be able to beat Sahi. It’s lightweight fast and effective in being able to identify and parameterize web objects and elements and convert them into usage automation tests that work across all major browsers. What it does, it does very well – though this is also its biggest strength in that it perhaps offers too little to justify for many development teams.
Comments