How To Run Cloud Selenium Tests On Your Laptop In A Minute

cerberus-run-cloud-selenium-test-laptop-in-a-minute

The majority of test automation platforms are going to the Cloud to improve the performance, availability and scalability of the solutions. While this tendency increases the quality of services, it creates new challenges.

You want to quickly execute your automated tests during their implementation. Short feedback loops allow you to quickly iterate on the right design and right coding. But once the test automation platform is in the Cloud, network connectivity is not easy.

In this article, we will share how you can configure Cerberus Testing, a remote Cloud test automation solution to execute tests on a Selenium Hub on your laptop:

  • Map out the necessary network information
  • Configure the required network routing
  • Quickly verify and test your configuration
  • Configure a robot for future execution

Let’s start by identifying the necessary configuration.

Map out the necessary network information

Understanding the main network flows is key for our configuration. As our cloud platform will execute the test through the internet, we first need to identify the public IP of our outbound traffic. Then we can identify our local IP within our local network.

You can identify your public IP using a variety of online services without specific technical skills. In our example, you can browse to the website https://www.showmyip.com/ to retrieve your public IP.

Figure 1: Start by retrieving your public IP on the internet

The next step is to identify our private IP within our network. The easiest way is to run local commands on your laptop, as your IP is usually dynamically set within your network. The commands are available on Windows (ipconfig), Linux (ifconfig) and macOS in a similar way. 

Figure 2: Run the operating system command to know your local network IP

In our example, the private IP is 192.168.9.103. We will use that information to configure our local network.

Configure the required network routing

From that moment you need to enable the link between your router and your laptop for the specific test automation traffic. By default, this type of traffic will not work; hence the need to force this configuration.

You can achieve that configuration yourself in your network box if you are at home. If you are in a corporate environment, you most likely need to ask for a specific configuration from your network team. In both cases, you have to configure port forwarding using the previously mapped network IPs.

Figure 3: Configuration of a port forwarding in a box

This configuration will forward all traffic from any IP that points to 14444 port to your local private IP 192.168.9.103 on port 14445. From increased security, you can allow this rule only from the Cloud test automation IP range.

We are now ready to test our configuration.

Quickly verify and test your configuration

We will check our setup in Cerberus Testing configuring the Selenium Hub directly in the test execution page. We can quickly test before performing a more robust and reusable configuration.

The first step is to launch your Selenium Hub on port 14445 so that the traffic routed from the internet to your laptop arrives at the correct destination. You can launch the selenium hub forcing that port easily with the parameter “-p 14445” from the command-line or configuration file.

Figure 4: The Cerberus Testing robot configuration on the test execution page.

The above screenshot shows the configuration you need to set on the “Robot Settings” of the Cerberus Testing execution page. You can verify your configuration by running the tests that should be running on your laptop.

Configure a robot for future execution

Now that our configuration has been confirmed, we can define a Cerberus Testing robot to keep it usable in the future. You can configure Robot by going to the “Run” and “Robots” parameters of the menu.

The good practice is to define explicitly the type of browsers supported, with all the relevant capabilities. If you are running various nodes on your Selenium Hub, you can also define the load-balancing rule.

Figure 5: The Robot configuration inside Cerberus Testing.

You can now perform fast test automation feedback loops from a Cloud test automation platform using a local hub. This is one way to iterate on your test automation.

Cerberus Testing natively provides robots and browsers in the SaaS platform to ease your journey. You can by default access various browsers and connect to other providers like BrowserStack, Kobiton, among others.

You can use Cerberus Testing for Free in the Cloud to accelerate your test automation journey.

How To Run Cloud Selenium Tests On Your Laptop In A Minute
Scroll to top