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
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.