Automating Peer-To-Peer Communications (Part 2 of 2)

Author : Tejaswini Simha

In the last part we covered the challenges and architectural approaches for automating  the call dispatch workflow for a Push To Talk service provider. In this part, we cover the setup, design & exeuction….

The Setup

  • The test execution server (Machine 1) hosts the Selenium Grid hub and the Appium / Android Studio and also the Chrome / IE browsers which runs the first web dispatcher.
  • Machine 2 has Chrome / IE browsers installed and also has Selenium Grid running as the grid node and connects to the Selenium Hub hosted on the execution server.
  • There is an Android device that has the customer’s Push-To-Talk Android app installed on it. This device is connected to the Appium hosted on the Test execution server.
  • The test scripts run as a batch application on the execution server and co-ordinate the end to end tests across the multiple web dispatcher nodes and android devices.
  • The test scripts are Selenium tests implemented in Java and use Test NG programmatically to execute the tests along with their dependencies.
  • The test scripts are built around a proprietary Last Mile framework

The Design / Execution

Using Selenium as a standalone server enables test executions on browsers installed on the local machine where the selenium standalone server is hosted. Controlling a test execution on a remote browser would not be possible through selenium in a standalone mode.

Selenium grid is traditionally used for multi browser execution parallel on multiple machines. This helps in load balancing the test servers as well as optimizing the test execution time.

We put to use this capability of multi browser – multi machine test execution of Selenium in the Grid configuration to solve our problem of achieving peer-to-peer communication across browsers and multiple android devices.

The local machine is configured as the selenium grid hub and the remote machine as the selenium grid node. Test scripts opens the browser sessions on the local machine as well the remote machine.  The Selenium Grid enables the remote web browser running on the Machine 2 to be controlled by the test script running on the execution server. The test script starts the PTT one-to-one call from the user logged in to local browser instance to the user logged into the remote browser on the remote machine. Selenium returns the test script a browser handle (driver instance) on launch of the browser on the local and remote machines. The script uses this browser handle to switch from the local browser context to the remote and vice-versa. The synchronization of the calls across the web dispatchers is handled by the test scripts hosted on the execution server using fluent waits implemented by the Last Mile framework.

Similarly, the group calls that spans across multiple web dispatcher nodes and Android devices are also controlled by the test scripts hosted on the execution server. This is achieved using Selenium Grid and Appium.

Call synchronization is implemented in the Last Mile framework using Selenium’s fluent wait and Java scripts.

 

Write to us, and we can demo our framework capabilities and help you accelerate your implementations.