Performance testing of web browser applications that provide web conferencing services, 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.

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
30 sec https://d149yd38g6ldk.cloudfront.net/30sec.wav https://d149yd38g6ldk.cloudfront.net/WebCam30s.y4m
1 min https://d149yd38g6ldk.cloudfront.net/1min.wav https://d149yd38g6ldk.cloudfront.net/WebCam1m.y4m

Using Custom Media Files

For load testing, please make sure the file storage system that you are going to use in the test has enough capacity to sustain a load during a test run. Otherwise, file download-related errors may occur during the test execution. For web performance monitoring scenarios, it is also important to use a very reliable storage system to ensure seamless access to test media and fast load time.

As a best practice to optimize the delivery of your media files to Dotcom-Monitor, when running load testing or monitoring, we recommend uploading your test media files to a reliable CDN storage.

Supported file formats and size limits

The media file size limit is 20 MB.

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.Microphone, string  wavfileName); 
UseFileForFakeMediaCapture (MediaType.Camera, string  y4mFileName);

Parameters Definition

wavFileName string  – .wav file name for audio emulation

y4mfileName string – .y4m file name for video emulation

wavFileURL  string – audio file URL

y4mFileURL string – video file URL

Make sure the file names are consistent across the script.

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=0; date=9/29/2022; Chrome=91.0.4472.77
Tabs.SetSize (1820, 471);
DMBrowser tab0 = null;
Step (1, "Index of /video/derf/y4m - https://media.xiph.org/video/derf/y4m/");
tab0 = Tabs.NewTab ();
//Download a test audio file
tab0.Download ("sample3.wav", "https://filesamples.com/samples/audio/wav/sample3.wav");
//Download a test video file
tab0.Download ("bus_qcif_7.5fps.y4m", "https://media.xiph.org/video/derf/y4m/bus_qcif_7.5fps.y4m");
//Emulate a webcam video stream and mic audio
UseFileForFakeMediaCapture (MediaType.Microphone, "sample3.wav");
UseFileForFakeMediaCapture (MediaType.Camera, "bus_qcif_7.5fps.y4m");
tab0.GoTo ("https://media.xiph.org/video/derf/y4m");
//Click a button to allow access to webcam
tab0.Button ("//BUTTON[normalize-space()=\"Init\"]", "//BUTTON[normalize-space(text())=\"Init\"]", "//DIV//BUTTON").Click ();
Delay ("10sec".ToDuration ());