WebRTC and Its Impact on Testing
Web Real Time Communications (WebRTC) is changing the way we have traditionally communicated and collaborated. To be specific, the technology allows developers to embed voice, data, instant messaging, and video into web browsers, thereby providing easier and far efficient ways to communicate than Voice Over Internet Protocol (VOIP) services such as Skype, WhatsApp, and WebEx.
WebRTC has come a long way since its inception in May 2011. Right from achieving interoperability between Chrome and Firefox browsers in 2013 to rolling out support for Android mobile, WebRTC has continued to garner more attention every year. And the market momentum is expected to continue growing. Infact, a recent Analysts Mason report predicts that with Apple and Microsoft incorporating WebRTC in their browsers, there might be 7 billion devices supporting WebRTC by 2020. With that strong growth rate, it is imperative for testers to have a strategy in place in order to test WebRTC applications efficiently. But before we venture down that path, it is critical to understand what’s driving this growth and how testing a WebRTC is different from any other web applications.
[caption id="attachment_21099" align="aligncenter" width="500"] WebRTC-enabled endpoints by device type, worldwide, 2013–2020 [Source: Analysys Mason, 2014][/caption]
Why WebRTC is gaining attraction? And why should you care??
- WebRTC gives web developers an access to Voice over Internet market: WebRTC opens up the VOIP market to web developers. Web developers no longer need proprietary technology to build solutions for the VOIP market. With WebRTC being open source and free to use, the barriers of entry for the VOIP market have been drastically reduced. This means we would see more developers using WebRTC to build real-time communication apps, therefore testers need to be ready.
- WebRTC makes it extremely easy for end-users to communicate: From the demand side perspective, there seems to be no issue as well. WebRTC makes the process of communicating much more seamless. Unlike VOIP services where consumers need to download and regularly update applications such as Skype or WhatsApp, WebRTC allows users to make calls just through a web page. The process is thereby friction-less, eliminating hurdles for user adoption.
Even for audio and video applications, a key advantage of WebRTC is that it allows developers to create more engaging and immersive real-time communications than existing VOIP services such as skype and what’s app. Take the example of ustyme, which allows end users to play games and read books while interacting with each other on video. Moreover, real-time video capabilities of WebRTC are now being integrated into a wide range of verticals, including business, medical, and education.
- Browser support for WebRTC continues to grow: Increased numbers of browsers are incorporating WebRTC. WebRTC infact now comes preinstalled with Chrome and Mozilla. Additionally, as WebRTC makes strides with standardization and as market continues to mature, Microsoft and Apple are expected to roll out support for WebRTC.
How WebRTC is different than testing current web applications?
- Growing Role of APIs in Web Apps: Web RTC applications are predominantly being driven by APIs. Hence, while testing a WebRTC application,you can no longer just base your test cases on the Graphical User Interface (GUI). As a tester, one needs to factor in how request and responses of the API impact the GUI.
How to test WebRTC applications?
In order to test a WebRTC application effectively, an integrated GUI and API testing solution is required. Biasing your tests just on the GUI is bound to fail as the video, file, or even audio returned by the API call is bound to change based on the request and response. For instance, if you want to check whether video stream works properly on two browsers, the testing steps would require testing both the GUI and API layer. Some of these steps could be:
- Allow automated testing solution to gain an access to the camera for video stream
- Testers would typically use the getUserMedia API for this action
- Start the two browsers and record actions using record and replay action
- Wait for the two browsers to get connected using the RTCPeerConnection API
- Check if connection state has established using the event iceconnectionstatechanged
- Once connection is established, check if the UI of browsers display the video stream properly
As seen in the above example, writing tests just on the GUI could be really brittle, especially when the GUI information changes based on getUserMedia API response. As a tester, you thus need to factor in response of the APIs while designing GUI tests for WebRTC apps.
As it stands, WebRTC is bound to grow. Testers therefore need to be better prepared to test these applications. Proactively incorporating practices that help test both the GUI and API layer could be critical to rolling out these applications bug-free to the marketplace.