OpKey VS Selenium

Opkey
5 min readFeb 23, 2021

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

About Selenium

Selenium is an open-source test automation tool that provide its APIs to automate the tests carried out on web browsers. Any action can be performed through the actions like click, set text, etc. by writing a piece of code. It also provides different options to write code. For example, user can write a code in java, python, C#, Ruby, javascript, etc.

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

  1. Open a Chrome browser and navigate to flipkart.com and maximize the window
  2. It will auto-launch the sign-in page
  3. Type a random email/Mobile Number and password and hit the login button
  4. Validate that an error message should appear “Please enter valid Email ID/Mobile number”
  5. 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.

  1. Create a WebDriver instance
  2. Navigate to the flipkart website
  3. Locate all the elements on the web page through the “Inspect Element” functionality
  4. Perform actions on the elements
  5. Anticipate the browser response to the action
  6. Run tests and see the results. If test fails, debug it and resolve the code
  7. Run again and see results till the code runs successfully
  8. 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.

--

--

Opkey

Opkey is a SaaS Based Automation Tool that allows you to easily automate testing of Oracle, Salesforce & Workday. https://www.opkey.com