Performance testing of web browser applications that provide web conferencing services (WebRTC), for example, remote exams, webcam checks, or online video conferencing web tools, may be complex.
For example, you may want to check how your system behaves when over 100 participants are connected to your online video conference platform and talking and streaming at the same time. While manual testing might be an option for occasional checks or small load tests, it is hard to cover all the scenarios and implement continuous monitoring and load testing when you have a limited number of testers and hardware. To facilitate this task, Dotcom-Monitor introduces a new webcam and microphone emulation feature that allows web conferencing load testing and monitoring in a browser window to deliver the most realistic test results.
Please visit our blog post WebRTC Load Testing Explained to learn more about WebRTC and the most effective approaches to Load Testing and Monitoring With WebRTC.
In this article, we will learn how to add the audio and video streaming emulation function to a test script with EveryStep Scripting Tool Desktop by Dotcom-Monitor.
How It Works
In a nutshell, Dotcom-Monitor emulates video and audio streams in a browser, every time a target web application requests access to a webcam and microphone on an end-user device. To do this, we run a pre-recorded sequence of user transactions in the Chrome browser and use custom audio/video files to pass the prerecorded media.
Dotcom-Monitor does not have locally available storage. Before executing the media streaming step, you need to deliver the media files to the script from an online publicly available file storage. Dotcom-Monitor will download the file from the provided URL to our system each time the script is executed and play it in a browser window to emulate a video and audio capture hardware.
If you do not have particular requirements to test media files, we recommend using the test files that you can download directly to the script from the Dotcom-Monitor CDN storage:
Audio File | Video File Load Testing | Video File Monitoring | |
10 sec | – | – | 10s.y4m |
30 sec | 30sec.wav | 30s.y4m | – |
1 min | 1min.wav | 1min.y4m | – |
Supported file formats and size limits
The media file size limit is 20 MB for web monitoring scripts and 150 MB for load testing scripts.
We currently support the following media file formats for test purposes.
For video files:
YUV4MPEG2 (a.k.a. Y4M)
You can find more information on the file format here: http://wiki.multimedia.cx/index.php?title=YUV4MPEG2
For audio files:
WAV
Recording Script Step-by-step Guide
First, download a desktop version of the EveryStep Scripting Tool. Please see how to install and use the tool in the Using EveryStep Scripting Tool Desktop article of our wiki.
In the desktop version of the EveryStep Recorder, record navigation to a target web conferencing application and initiate a media streaming session (e.g., click Start Video or Allow Access to Webcam). Then save the script.
To add media stream emulation steps, add the following methods before the web app navigation lines:
tab0.Download (string wavFileName, string wavFileURL); tab0.Download (string y4mFfileName, string y4mFileURL); UseFileForFakeMediaCapture (MediaType.Camera, string y4mFileName); UseFileForFakeMediaCapture (MediaType.Microphone, string wavfileName);
To reserve additional time for the media streaming step, add the Delay line at the end of the media streaming step.
Find the script sample below.
// script_version=3.0; everystep_version=4.0.8370.4032; date=4/23/2023; Chrome=104.0.5112.57; Use System Credentials Tabs.SetSize (1768, 876); DMBrowser tab0 = null; Step (1, "Webcam Test - Check Your Camera With Our Online Tool - https://www.onlinemictest.com/webcam-test/"); tab0 = Tabs.NewTab (); //Download a test audio file tab0.Download ("30sec.wav", "https://d149yd38g6ldk.cloudfront.net/30sec.wav"); //Download a test video file tab0.Download ("WebCam30s.y4m", "https://d149yd38g6ldk.cloudfront.net/WebCam30s.y4m"); //Emulate a webcam video stream and mic audio UseFileForFakeMediaCapture (MediaType.Camera, "WebCam30s.y4m"); UseFileForFakeMediaCapture (MediaType.Microphone, "30sec.wav"); tab0.GoTo ("https://www.onlinemictest.com/webcam-test/"); //Click a button to allow access to webcam tab0.Div ("//DIV[@ID=\"webcam-start\"]", "//DIV[@ID=\"fullscreen_close\"]/following-sibling::DIV[1]", "//DIV[@ID=\"fullscreen_open\"]/following-sibling::DIV[2]").Click (); Delay ("10sec".ToDuration ());