Running Tests on Remote Linux Machines With Opkey Personal Edition
Running Tests on Remote Linux Machines With Opkey Personal Edition
October 7, 2016
Iffat Ara Khanam
Opkey Personal Edition comes with underlying testing tool Selenium Webdriver. Although Opkey can only be installed on a Windows machine, Selenium Webdriver has capabilities to automate applications across different operating systems. So does Opkey limit 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 a 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, if the underlying tool doesn’t support different OS test automation, Opkey with that tool will also not support.
The below Flow gives 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 Hub
Open Terminal in Linux and type the following command:Java -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 https://localhost:4444/grid/console in a browser window.
Starting Node
Now open another terminal and start the node from the same Selenium standalone server package with the following command:Java -jar <absolute path to selenium-server-standalone.jar> -role node -hub https://localhost:4444/grid/register
We are using the same Selenium standalone package as this package itself includes Hub, Webdrivers, and RC.
Windows Machine
Now return to the Windows machine where Opkey is installed. We need to provide some specific settings in the Opkey Plug-in setup wizard.
Settings required in Opkey:
- Provide Host Name of the Linux machine.
- Provide Port No. on which the Selenium Hub is started on the Linux machine (by default Hub automatically starts on port 4444).
- If you want to execute your flow on Chrome, provide the Chrome driver path in the Plug-in Setup Wizard (no settings are required for Mozilla Firefox).
So as we see in the above settings, we understand that the Selenium webdriver host is a Linux machine. Thus, as the test run is scheduled, Opkey will pass on the Selenium command to the Selenium server host machine, in this case, Linux. The automation of the application under test will be executed over the Linux machine, whereas Opkey will be on the Windows machine.
One thing to note here is that this topic is created purely for how with Opkey Personal Edition you can run tests on a Linux machine. 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 in parallel. Now do your test run on the Opkey Cloud.
Iffat Ara Khanam
Technical Content Lead
Iffat is the content lead at Opkey. She has expertise in writing technical content focused on ERP testing, Cloud apps, automation, and other IT-related topics. She has rich experience in writing content for marketing collateral like whitepapers, case studies, newsletters, etc., which helps in funnel creation for sales.