OpKey Personal Edition comes with underlying testing tool Selenium Webdriver. Although OpKey can only be installed on a windows machine, but Selenium Webdriver has capabilities to automate applications across different operating systems. So does OpKey limits the Selenium web driver to windows? The answer is a definite NO.
OpKey ensures that the underlying plug-in capabilities are enhanced. Over a period of time we received a list of queries on our support Forums about how with OpKey we can perform test runs on linux as well. This Blog post will guide you to execute your OpKey tests on Linux machine with Selenium Web Driver as the underlying plug-in. We have to be clear about a thing although OpKey can do whatever the underlying tool can do and much more. But if the underlying tool doesn’t support different OS test automation, OpKey with that tool will also not support.
The below Flow give you an idea about the communication between OpKey, Selenium Hub and Selenium Node.
Linux Machine– Let’s start with Linux machine.- Steps to Start Hub and Node on Linux machine
Starting HubOpen Terminal in Linux and type following commandsJava -jar <absolute path to selenium-server-standalone.jar> -role hub
The hub by default starts using port 4444. To change the default port, you can add the optional parameter -port when you run the above command. You can view the running status of the hub by opening the URL http://localhost:4444/grid/console on a browser window.
Starting Node Now open another terminal start the node from the same *Selenium standalone server package with following commandsJava -jar <absolute path to selenium-server-standalone.jar> -role node -hub http://localhost:4444/grid/register
*We are using same Selenium standalone package as this package itself includes Hub, Webdrivers and RC.
Windows MachineNow return to Windows machine where OpKey is installed.We need to provide some specific settings in OpKey Plug-in setup wizard.
Settings required in OpKey:1. Provide Host Name of Linux machine.2. Provide Port No. on which Selenium Hub is started on Linux machine. (By default Hub automatically starts on port 4444.)3. If you want to execute your flow on Chrome Just provide Chrome driver path in Plug-in Setup Wizard. (No settings are required for Mozilla Firefox.)
So as we see the above settings we understand that the Selenium webdriver host is a linux machine. So as the test run is scheduled, OpKey will pass on the selenium command to the selenium server host machine, in this case Linux. And the automation of the application under test will be executed over linux machine, where as OpKey will be on the windows machine.
One thing to note in here is, as this topic is created purely for How with OpKey Personal Edition you can run tests on linux machine so, for the same reason you will only be able to use one machine. With OpKey higher editions we get distributed test execution power by using OpKey Agent. There is also a simpler way of running your tests on different browsers and OS and that too in parallel. Now do your test run on the OpKey Cloud.
Please feel free to share your thoughts on this topic in the comments section.
Radhe Shyam Prajapati