In this age of rapid digitalization of consumer experience and ERP transformation, Test Automation is no longer a question of “Why or If”. It has rather become a question of “How”…How efficiently we can create test scripts. How easily we can maintain tests with changing application. And How we can scale test automation to increase test coverage.
And in that context, Selenium Webdriver is one of the most recognized Test Automation tool in industry. Developed by Jason Huggins in 2004, it really took off after merging with Webdriver in 2009. It is estimated that developers and test engineers across 50,000+ organizations worldwide use Selenium Webdriver to automate their regression (and other) testing
But one fact to keep in mind is Selenium is primarily a tool for Developers or SDETs (Software Developer Engineer in Test) as many companies like to call them. However, as many enterprises are realizing that to truly enhance test automation adoption, it has to be adopted by functional testers as much as developers. These functional testers are strong testers who may not like to code or may be even don’t know how to write a code. They can be functional users, manual testers, Business users or any such of these people.
And that’s where platforms like “OpKey” are gaining fast traction amongst enterprises.
We are often asked how OpKey compares to Selenium. Or “If we have Selenium, why do we need OpKey”. So we thought of putting together a small comparison between selenium webdriver and OpKey. Please don’t get us wrong. In no way are we be-rating WebDriver. In fact everyone in our team is inspired by Selenium WebDriver and what it has done for Test community. We just want to put forward some alternate arguments so that you can make the best choice depending on your situation.
So, let’s get started
Benefits of using Selenium?
Here are reasons behind Selenium’s ever growing popularity:
- It’s an open-source tool hence there is no licensing cost involved
- It allows us to write test cases in different programming languages like Java, Python, C#, PHP, Ruby, Perl & .Net
- Tests can be carried out in any of these Operating systems : Windows, Mac or Linux
- Supports all major browsers including Mozilla Firefox, Internet Explorer, Google Chrome, Safari or Opera
- Gives feature to integrate with tools such as TestNG & JUnit for managing test cases and generating reports
- Can also be integrated with Maven, Jenkins & Docker to achieve Continuous Testing
- Also possess an option to run parallel executions with cloud provides like Saucelabs and BrowserStack
Being open-source, it becomes the first choice when any organization goes for test automation. And enterprises hire engineers who are good in programming and have years of experience writing reusable and maintainable code.
Let’s move ahead and try to explain what all it takes to create a short test automation script with Selenium
- Open a Chrome browser and navigate to flipkart.com and maximize the window
- It will auto-launch the sign-in page
- Type a random email/Mobile Number and password and hit the login button
- Validate that an error message should appear “Please enter valid Email ID/Mobile number”
- Close the browser
We’ll see how this above code can be written in Selenium WebDriver and then try to replicate the same scenario with OpKey and see the difference
First, here’s what the Selenium code looks like:
An example of Selenium automation, written in java
Let us now explain what’s there behind the written code.
- Create a WebDriver instance
- Navigate to the flipkart website
- Locate all the elements on the web page through the “Inspect Element” functionality
- Perform actions on the elements
- Anticipate the browser response to the action
- Run tests and see the results. If test fails, debug it and resolve the code
- Run again and see results till the code runs successfully
- Conclude the test
Now, just to let you know it looks quite simple as per the above steps but simple only for an experienced selenium coder and again the word “simple” can be categorised differently by users having different skill sets. An experienced Selenium coder might take 20 minutes to write a code like this but for someone like me, a functional user, writing the above code, it failed 3-4 times since it was not able to find the element with the “class” property given.
Error snapshot while running selenium code
And then I realized, it’s not as straightforward as it looks. While looking for solutions, it was mentioned on one of the google search links, it was mentioned that use another property. But, again, there was no other property defined. (Have a look at the below screenshot and you’ll see that no other property is defined there like id, name, etc.)
So, it all comes to another property called as xpath. Although, there are multiple third party extensions and tools available online to create xpath for you but isn’t it an overhead? For an experienced selenium coder, it’s easy to create xpath but not for the others. Well, I somehow created the xpath (Remember I belong to the non-coding background) and executed the test and it finally ran successfully.
Now, let me take you through to the same test that I created with OpKey, my partner in creating automated test cases for our customers. Here’s the snapshot of the same code written in OpKey.
Look at the screenshot above, it just 5 simple predefined keywords added to create this script. And the process of creating this short test case is even more exciting to know. OpKey has a recorder which can record the steps as and what you perform on the screen. Here’s the screenshot below which hardly took me a minute to record and create this script.
The hard and the sad part of the story is that even for selenium professionals, the code becomes unmaintainable as it grows with time. Any new member of the team takes time to understand this code and hence time will be heavily involved. So, basically I want to convey here is that resource dependency would be there. Organizations like to believe that Selenium, being an open-source tool doesn’t involve cost but generally it’s not the case. Obviously, they might have not seen and analysed these low code/no code platforms.
Video Demonstration: Selenium vs. OpKey
Pros and Cons of using Selenium and OpKey
|Usability and Adoption|
|Using Selenium WebDriver||Using OpKey|
|Coding skills required||Yes, can be used by programmers who knows either of the below programming language (C#, Java, Python, PHP, etc).||No, absolutely zero coding skills needed here. Anyone can code and create test cases by dragging and dropping the prebuilt set of 800+ keywords|
|Object finding skills (how to create xpath)||Yes, very much required as in case of dynamic websites, object attributes like name, id and class are similar||4 different sets of xpath gets automatically created while recording the tests.|
|Data-driven automation||Selenium doesn’t provide inbuilt data sheets to store. So, it needs heavy coding skills to create and save excel sheets of data and map it with the code.||Inbuilt data repository (global and local) is part of OpKey used only for data driven automation. Just provide data to it and it will automatically iterate your tests|
|Learning curve||Selenium typically takes 3-6 months for an initial learning as it involved learning specific coding language that works with Selenium. On top of it, another 6 months to create a framework||Generally, within a 8 to 16 hours of training can allow any specific user to create simple tests|
|Future enhancements||Selenium is an open source tool, so there is no such roadmap and it depends completely upon the programmers across the globe to contribute for new features||OpKey always tries to contribute to the latest technologies and enhancements. Impact Analysis, Self-healing and Model Based Testing are just few examples here|
|Training and Support||Lot of online communities and youtube videos are available to find the training material but coding skills are required to understand. No official support is there.||OpKey gives online support and chat services in both India and US time zone. Moreover, complete online help portal including videos are available. Training is also an integral part of the system.|
Dashboard and Reporting
|Reporting and debugging||No reporting structure available. Programmers have to create their framework including reporting to get proper results and debugging||Reporting and dashboards are included out of the box. Debugging can be easily understood by any OpKey user as it captures step by step screenshot and gives reasons of failure of any particular step|
|Inbuilt Object repository||Selenium does not include an inbuilt object repository but they can create and implement one. For example – Page Object Model||Object repository is inbuilt which saves all the object attributes. It gets created automatically while recording the tests, hence no separate effort required.|
|Audit trails for tracking||No such feature available with Selenium||Since multiple user implementation is there, audit trails are part of tracking things. OpKey comes up out of the box different levels of audit trails|
|End to End Automation||Selenium can only automate web applciations||OpKey can automate a flow which can start with web, goes to mobile apps and then to back-end database. Any other combination can also be tested seamlessly with OpKey|
|Mobile applications||Selenium doesn’t support mobile apps automation||OpKey comes up a seamless mobile apps (Android and iOS) automation solution|
|SAP||Selenium only supports automation of web applications. SAP is not supported||OpKey has SAP GUI recorder (S/4 Hana and SuccessFactors) built-in along with prebuilt set of test cases for SAP|
|Windows applications||Not supported as they are outside the browser||Different windows applications are supported like WPF, C#, Win forms, Telerik, etc.|
|Citrix applications||Citrix applications are not supported.||Works across all platforms and technologies. Citrix and other such technologies are supported with advanced text and image recognition capabilities.|
|Mainframe applications||Mainframe terminal applications are not supported with Selenium||Specific mainframe terminal recorder is available in OpKey that can work on it seamlessly|
|Java and Oracle applications||Java applications and Oracle Forms are not supported in Selenium||OpKey has inbuilt recorder available for Oracle EBS and Java applications which can be utilised.|
|API and Databases||APIs and Databases can be automated with Selenium but advanced skills are required||Out of the box support with prebuilt keywords for databases and service repository for APIs|
Test Execution and Integrations
|Scheduler||No scheduler is included. Programmers can use a unit-test framework in combination with a custom-built scheduler or build pipeline.||Inbuilt scheduler is there and runs can also be triggered through CI tools like Jenkins, Bitbucket, Azure DevOps, etc.|
|Auto Synchronization||With Selenium, it is all about adding implicit and explicit waits in the scripts but that becomes useful when application objects loads up separately as per the browser status||OpKey has its own AI login written at plugin level that automatically waits for different back-end calls running and hence absolutely zero wait times are needed|
|Parallel Execution||Selenium allows runs in distributed and parallel environments, but requires programmers to build a custom automation framework which typically takes 6-9 months of effort.||OpKey has a concept of agent which can be installed on any windows machine and can be used for distributed and parallel executions.|
|OS – Browser platform||Selenium tests can be integrated with third party platforms like BrowserStack, etc. to execute runs in parallel on different OS – Browser combinations||OpKey has its own platform pCloudy which gives different OS – Browser combinations. It also integrates with BrowserStack and SauceLabs to execute tests.|
|Built-in CI/CD plugins||Almost all CI/CD platforms can be used by custom-built solutions but again only skilled programmers can use the same||OpKey comes with Day 1 integration with almost all popular CI tools like Jenkins, Hudson, Bit-Bucket, Azure DevOps, etc.|
Other Path Breaking Features for OpKey
- Prebuilt Accelerators – OpKey comes with prebuilt accelerators for applications like SAP, Oracle EBS, Oracle Cloud, Salesforce, Workday, MS Dynamics, Trackwise, Kronos, etc. This allows users to use the prebuilt test cases without even creating the same from scratch. Just fill in the data and execute.
- Impact Analysis and Self-Healing – If you have worked with applications like Salesforce, Oracle Cloud, MS Dynamics, Workday, etc, then you must be knowing how difficult is to maintain the test cases once the new upgrade comes in. This is not the case with OpKey though, OpKey can detect and identify the changes between 2 versions of these applications and highlight the impacted test cases. Then it also gives option to self-heal (auto-heal) the scripts by a click of a button. Isn’t it cool?
- Model Based Testing – OpKey comes up with Model Based Testing feature that can be used to perform automated exploratory testing. It can generate automatic test cases and can also perform impact analysis once a user performs any change in the created model. All impacted test cases can be highlighted and can be self-healed by a click of a button.
- Self-Configuring Tests – OpKey provides a unique feature it can read the back-end configurations of applications like Oracle and Salesforce and create required sets of positive and negative data for the tests. This saves tons of time for creating and maintaining data for the test cases.
- Image based and Text based Object Identification – This is again a feature where OpKey provides inbuilt keywords which can find objects just by providing either a snapshot or the text. Although this can be performed through selenium by integrating some third party libraries but it requires immense amount of programing skills and time to take it over.
Finally, at the end I would like to conclude that try OpKey to see the difference yourself. We already had our customers realise the power of it and we would certainly like to showcase it to all our future customers.
Author: Vivek Tomar